I'm really stuck on an rsync problem and I haven't been able to crack it by reading the documentation. I want to make 7 directories, one for each day of the week, for back-ups of some folders and files from my server. The problem I'm having is rsync seems to be deleting the directories it back up the day before.
For example...
/backup/Monday will contain the files I moved over, but not the directories /backup/Tuesday/ will contain the files and the directories
I would like the Monday directory to contain all the files that existed on Monday and the Tuesday directory to contain all the files that existed on Tuesday.
Here is my script:
ssh [email protected] 'find /backup/staging/ -mtime +7 -exec rm -rf {} \;' crontab -l > $(date +%Y%m%d).crontab mysqldump -password cherry --all-databases> $(date +%Y%m%d)_cherrydb.sql rsync -a --log-file=$(date +%Y%m%d).log /var/www/admin /var/www/customers /var/www/UploadedFiles /etc/apache2/certs /etc/apache2/sites-enabled $(date +%Y%m%d).crontab $(date +%Y%m%d)_cherrydb.sql [email protected]:/backup/staging/$(date +%A)/ rsync -a $(date +%Y%m%d).log [email protected]:/backup/staging/$(date +%A)/ rm $(date +%Y%m%d).log rm $(date +%Y%m%d).crontab rm $(date +%Y%m%d)_cherrydb.sql
rsnapshotfor "rsync plus depth" backups?