Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

rsync syntax

Posted on 2010-08-22
5
Medium Priority
?
780 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

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

Author Comment

by:phasevar
ID: 33498371
No luck
0
 
LVL 2

Accepted Solution

by:
arunkeerthan earned 2000 total points
ID: 33499440
Try

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


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


Thanks

Arunkeerthan
0
 
LVL 17

Expert Comment

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

Author Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

730 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