Для резрвного копирования /data/backup следует использовать NAS систему
Скрипт на NAS
[Bill@NAS-BSA backup]$ cat ./a #!/bin/bash BACKUPDIR=/share/homes/Bill/backup LEAVE_DAY=7 echo "---------------------" >> $BACKUPDIR/client_backup.log echo $(date +"%d-%m-%Y %T") START >> $BACKUPDIR/client_backup.log /usr/bin/rsync -aze "ssh -p 22" --progress bill@192.168.0.7:/data/backup/ $BACKUPDIR # Delete files from persistant backup directory more than $LEAVE_DAY days from persist directory find ${BACKUPDIR}/day -type f -mtime +$LEAVE_DAY -exec rm {} \; # For QNAP NAS system # xargs rm -f <<< $(find ${BACKUPDIR}/day -type f -mtime +${LEAVE_DAY}) echo "$(date +"%Y-%m-%d %H:%M:%S") Delete files in ${BACKUPDIR}/day more than $LEAVE_DAY days" >> ${LOGFILE} echo $(date +"%d-%m-%Y %T") Finish >> $BACKUPDIR/client_backup.log echo "---------------------" >> $BACKUPDIR/client_backup.log echo " " >> $BACKUPDIR/client_backup.log