I'm trying to set up rsync to send incremental backups to a remote server. The first backup would go to a "backup" folder, then the next backup would send only the changes to a "backup.1" folder, and so on.
I managed to do this locally with the following command, which seemed to be working as described, creating a backup.1 folder on the second sync :
rsync -zaP folder_to_backup /backup
I then set up a ssh key pair and managed to get rsync working remotely, so I'm now using :
rsync -zaP folder_to_backup myuser@myserver:/home/myuser/backup
The sync does work and the files appear on the remove server. But once I run it a second time, the new files simply get added to the existing "backup" folder, rather than creating a backup.1 folder. I also tried other commands with the -b argument, such as :
rsync -zaPb folder_to_backup myuser@myserver:/home/myuser/backup
rsync -aPb --backup-dir=`date +%s` folder_to_backup myuser@myserver:/home/myuser/backup
But it acts the same in all case. In the last case, the sync still goes to the "backup" folder, the backup-dir argument seems to be ignored completely.
What am I doing wrong?
Edit : Reading the comments, it's possible I got confused somehow when I say "which seemed to be working as described, creating a backup.1 folder on the second sync". That's how I remember it but apparently it's not a feature of rsync?
Instead, I now installed rsnapshot, which is great for incremental backups.