linuxShortcuts/Services/backup-contabo.sh
Bruno Fontes 95b5a30bce
Backup script updated
1. Moving message at the terminator command line, but inside the script
itself.

2. Fixing mail backup filename on line to delete old backups
2020-05-21 16:01:29 -03:00

11 lines
484 B
Bash
Executable File

#! /bin/bash
sleep 60
/bin/rsync -a -e "ssh -i /home/bruno/.ssh/id_rsa_backup" mybackup@167.86.78.36:/home/bruno/backups/* /home/bruno/Backups/Contabo/
# Delete old backups
find /home/bruno/Backups/Contabo/db -type f -name "*.sql.gz" -mtime +15 -delete
find /home/bruno/Backups/Contabo/files -type f -name "*.*" -mtime +35 -delete
find /home/bruno/Backups/Contabo/mail -type f -name "*.*" -mtime +20 -delete
find /home/bruno/Backups/Contabo/ -type f -name "*.*" -mtime +120 -delete