LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-07-2007, 07:44 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
RSYNC Two Folders?


I wanted to make sure my external backup USB drive located and mounted on /media/disk/ gets mirrored with my /home directory where I store all my personal / important data.

I always make changes and modifications /home/ so I want the changes I make on /home to be reflected on /media/disk/.

So with this data, can someone please tell me if this is correct or if I need to make any modifications? I have no idea what happened with this command but I beleive I made an error as I did not see my files folder from my home directory copy over to /media/disk for whatever reason.

Any thoughts on what I did wrong?

Code:
carlos@tunafish:~$ rsync -avz --delete -e /media/disk/ /home/carlos/files/
building file list ... done
drwxr-xr-x        4096 2007/09/07 20:30:52 .
-rwx------      387072 2007/03/27 17:44:33 idelab revised 8-8-06.vsd
-rwx------        2574 2007/04/17 15:30:22 linux_commands.txt
-rwx------         235 2007/03/27 18:00:05 mysql.txt
drwxr-xr-x        4096 2007/09/07 20:02:55 admin
-rwx------         381 2007/03/27 17:44:33 admin/create_calendar.txt
-rwx------          47 2007/03/27 17:44:33 admin/stricom_vlk.txt

sent 272 bytes  received 20 bytes  584.00 bytes/sec
total size is 516261  speedup is 1768.02
 
Old 09-07-2007, 08:11 PM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
rsync -rdtvu /home/<user> /media/disk/ The first argument after the options is the source, the second the destination
 
Old 09-08-2007, 05:33 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by Dutch Master View Post
rsync -rdtvu /home/<user> /media/disk/ The first argument after the options is the source, the second the destination
So what happens if I set this up as a CRON job & I if I delete files under /home/<user> (source), how do I make sure the files I delete from my source are being deleted or updated on /media/disk/ (destination)?

Thanks again for this info!

Below is my cron entry however I don't know if this will delete files as noted above...any modifications I need to make?

Code:
# m h  dom mon dow   command
0 3 * * * rsync -rdtvu /home/carlos/ /media/disk/

Last edited by carlosinfl; 09-08-2007 at 05:44 PM.
 
Old 09-09-2007, 12:17 AM   #4
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
You should add --delete switch:

rsync -rdtvu --delete /home/carlos/ /media/disk/

best,
Ott
 
  


Reply



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 daemon or not - multiple folders yull Linux - General 4 02-24-2009 05:09 AM
excluding folders in a rsync command troubles cucolin@ Linux - Server 18 04-10-2007 10:59 AM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 01:13 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
using rsync - one of the folders in path has spaces??? jgruss Linux - Networking 10 07-07-2004 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:20 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
Open Source Consulting | Domain Registration