Blake Carver
2007-Jan-29 15:42 UTC
Question on --backup --backup-dir Switches For Incremental Backs
I current do some rsync backups with a command like so every day rsync -az -e ssh --stats --delete --exclude "stuff" / user@server:/home/user/ What I want to do is have some incremental backups in there in subdirectories. So, for example, something like this on the remote server /home/user/something.tuesday /home/user/something.friday I thought the --backup --backup-dir Switches were used to store just the files that had changed in seperate directories, am I wrong on that? I've read everything I could find, including the big rsnapshot scripts, but I'm not able to do what I want, it seems so simple but something's not right, am I wrong that subdirs should have just files that are new or have changed. I tried various things like this, but had no luck rsync -az -e ssh --stats --delete --backup --backup-dir=/home.Thursday --exclude "stuff" / user@server:/home/user/ Thanks!
Paul Slootman
2007-Jan-29 16:10 UTC
Question on --backup --backup-dir Switches For Incremental Backs
On Mon 29 Jan 2007, Blake Carver wrote:> I current do some rsync backups with a command like so every day > > rsync -az -e ssh --stats --delete --exclude "stuff" / > user@server:/home/user/ > > What I want to do is have some incremental backups in there in > subdirectories. So, for example, something like this on the remote > server > /home/user/something.tuesday > /home/user/something.friday > > I thought the --backup --backup-dir Switches were used to store just > the files that had changed in seperate directories, am I wrong on > that?You're right on that account. Why do you want incremental backups? Things like dirvish or rsnapshot (I'm not so familiar with rsnapshot) will create complete backups that don't take that more space than incrementals (the main difference is the space needed for the directory structure, common files are hard-linked between versions). If I then want to restore from a specific day, I don't have to gather all the incremental versions one after the other, and that's not taking into account files that have been deleted between days... I'd recommend using the --link-dest option. Start with one day, e.g. Monday, and then use that as a basis for Tuesday: rsynz -az --stats --delete --exclude "stuff" --link-dest=../something.monday / user@server:/home/user/something.tuesday/ You may want to also use -H in addition to -a to preserve hardlinks from the source. Paul Slootman
Wayne Davison
2007-Jan-29 18:25 UTC
Question on --backup --backup-dir Switches For Incremental Backs
On Mon, Jan 29, 2007 at 10:34:39AM -0500, Blake Carver wrote:> I thought the --backup --backup-dir Switches were used to store just > the files that had changed in seperate directories, am I wrong on > that?It stores the old files that are being updated or deleted, moving (or copying) them before they are changed in the current transfer. If you want to store the new, changed files, use one or more --compare-dest options (one pointing at an old full backup, and an extra option for any intervening incrementals). However, I think that --link-dest is a better way to go for any OS that supports the hard-linking of files. ..wayne..