Results 1 to 3 of 3
I need some help with rsync. Let me explain what it is I'm trying to do. Let's say the root of my system looks like this...
/backups/
/dir1/
/dir2/
/dir2/backups/
...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-17-2006 #1Linux Newbie
- Join Date
- Aug 2005
- Location
- Sterling, VA
- Posts
- 100
need rsync expert
I need some help with rsync. Let me explain what it is I'm trying to do. Let's say the root of my system looks like this...
/backups/
/dir1/
/dir2/
/dir2/backups/
/dir3/
...
/dir10/
Now what I want to do is sync dir1 through dir10...basically grab the whole root and store it in /backups. And of course I want to exclude the /backups directory because that will have the backed up data.
So I try this:
rsync -avz --exclude=backups/ / /backups/
That would work, except the /dir2/backups directory would also be skipped.
Does anybody know of a way to be more specific about a directory you want skipped.
To be more clear about what it is I want to do...
I want to backup my entire hard drive, skipping things like /proc, /mnt, /dev, and the /backups directory I'll be making. I want to specifically exclude those directories, rather than specifically including the directories I want.
Any help would be appreciated. Let me know if this is not clear and I will try and explain better.
Thanks in advance,- EndianX -
- 01-17-2006 #2
try
that states to exclude the backups directory in / .Code:rsync -avz --exclude=/backups/ / /backups/
- 01-17-2006 #3Linux Newbie
- Join Date
- Aug 2005
- Location
- Sterling, VA
- Posts
- 100
Humph.
I tried that in my testing (a subset of directories) and it wasn't working. But since you said it would work I tried it on the real thing ( on / ) and it worked. I now have a script to make a copy of my drive, and a script to resync my files with it.
Thank you for the help!- EndianX -


Reply With Quote
