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...
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,
that states to exclude the backups directory in / .
rsync -avz --exclude=/backups/ / /backups/
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!