Solved

rsync syntax

Posted on 2010-08-22
5
762 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
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 500 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 16

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
number in printf 13 33
hp laptop model 10 63
Using Linux to replace Windows Server 2008 R2 for network drives 5 107
PHP website on Linux - server DNS address could not be found. 18 50
VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

830 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