Solved

using rsync on linix

Posted on 2013-06-10
2
411 Views
Last Modified: 2013-06-18
hello there,
I currently use this command to sync my site with my backup server.
I removed some files and I am wondering if by using this the files in the backup server will be deleted too..

rsync -azrtlpog -e ssh /home/virtual/sites/site.com root@74.86.98.12:/backup/sites/
0
Comment
Question by:XK8ER
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 39236902
No, they won't.

Deleting extraneous files from dest dirs must be forced by using one of the "--delete" options (see below).

By the way, the option "-a" already includes the options "-rtlpog" so there's no need to specify them explicitly.


      --del                            an alias for --delete-during
     --delete                       delete extraneous files from dest dirs
     --delete-before        receiver deletes before xfer, not during
     --delete-during        receiver deletes during the transfer
     --delete-delay          find deletions during, delete after
     --delete-after           receiver deletes after transfer, not during
0
 
LVL 28

Assisted Solution

by:serialband
serialband earned 250 total points
ID: 39242646
Here's the command to use.

rsync -az -e ssh --delete  /home/virtual/sites/site.com root@74.86.98.12:/backup/sites/ 

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provideā€¦
Fine Tune your automatic Updates for Ubuntu / Debian
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

803 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