Solved

using rsync on linix

Posted on 2013-06-10
2
389 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 27

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

706 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

19 Experts available now in Live!

Get 1:1 Help Now