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 directoriesI 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 root@173.192.114.131 'find /backup/staging/ -mtime +7 -exec rm -rf {} \;'crontab -l > $(date +%Y%m%d).crontabmysqldump -password cherry --all-databases> $(date +%Y%m%d)_cherrydb.sqlrsync -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 root@173.192.114.131:/backup/staging/$(date +%A)/rsync -a $(date +%Y%m%d).log root@173.192.114.131:/backup/staging/$(date +%A)/rm $(date +%Y%m%d).logrm $(date +%Y%m%d).crontabrm $(date +%Y%m%d)_cherrydb.sql
Rsync deletes files in old directory?
bash;shell script;rsync