Solved

rsync syntax

Posted on 2010-08-22
5
745 Views
Last Modified: 2013-12-16
I am trying to setup an rsync script to sync files over the network.

I have files in a directory "my_dir".

I want those files copied to "remote_host:other_dir_name".

My command is: rsync -aR my_dir user@remote_host:other_dir_name

However, after it runs, on the remote host I get "other_dir_name/my_dir".

I don't want "my_dir" to be on the remote host.  I just want the files (and subdirectories) from "my_dir" to be replicated in "other_dir_name".

What syntax do I need?
0
Comment
Question by:phasevar
5 Comments
 

Expert Comment

by:goodfela26
Comment Utility
Try adding a "/" to my_dir, e.g. "rsync -aR my_dir/ user@remote_host:other_dir_name"
0
 

Author Comment

by:phasevar
Comment Utility
No luck
0
 
LVL 2

Accepted Solution

by:
arunkeerthan earned 500 total points
Comment Utility
Try

#  rsync -avz mydir/ user@remotehost:/otherdir/


Put the / as i told you....you will get it...dont misplace the /..


Thanks

Arunkeerthan
0
 
LVL 16

Expert Comment

by:gelonida
Comment Utility
add a slash AND  a .
rsync -aR my_dir/. user@remote_host:other_dir_name/.
0
 

Author Comment

by:phasevar
Comment Utility
Had to take out the -R and add a trailing slash.  Thanks all!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now