LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 15
rsync - what actually happens?


MY COMMAND:
rsync -e 'ssh -p 22' -avl --delete --stats --progress root@domain.com:/var/www/html ~/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, 08:39 AM   #2
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 72

Rep: Reputation: 22
Quote:
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.

http://code.google.com/p/lsyncd/
 
Old 11-02-2013, 08:56 AM   #3
usafitz
Member
 
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46

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


Reply

Tags
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 + ld.so.1: rsync: fatal: libiconv.so.2: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 04:23 AM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 02:39 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 10:48 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 05:08 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM


All times are GMT -5. The time now is 02:21 PM.

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