Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-02-2013, 07:00 AM   #1
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46

Rep: Reputation: 15
rsync - what actually happens?

rsync -e 'ssh -p 22' -avl --delete --stats --progress ~/backuptest

Hello everyone. I'm new to rsync, so I was curious if you could shed some light on what happens behind the scenes. With my above command, the files will backup to the specified directory. But if I were to change '~/backuptest' to '/var/www/html' would it replace all of the files in there that are outdated?

Also, I was tinkering with lsync and it looks like the program is nothing more than a scheduler for rsync. Is that correct? Can/should I just do that function with a cronjob?

thanks for the help!
Old 11-02-2013, 07:39 AM   #2
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 72

Rep: Reputation: 22
But if I were to change '~/backuptest' to '/var/www/html' would it replace all of the files in there that are outdated?
Yes. using the --delete option, as you are, it will also delete any files it finds in the target which do not exist in the source location. If this is preferred, additionally you can add the -m option to prune empty directories as well.

So if you want to keep what's in /var/www/html on the system running this command, I would recommend backing the contents up to a different directory prior to attempting the above.

lsync is essentially intended to automate the process of directory synchronization. If I understand it properly it's slightly better than running your command in cron every so often as it will monitor the directory and perform synchronizations more quickly when changes do happen or not run an unnecessary rsync operations when changes haven't happened. The google code page summary also specifically states that it was designed for low profile of expected changes, e.g. contents where a few files here or a new directory there happen rather than large sweeping changes on a regular basis.
Old 11-02-2013, 07:56 AM   #3
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46

Original Poster
Rep: Reputation: 15
Awesome, thanks for the help and the reference!


centos6, rsync+ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync solaris + rsync: fatal: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 03:23 AM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 01:39 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 09:48 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 04:08 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration