Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- timestamp=$(date +%Y-%m-%d-%s)
- # Eliminar ficheros de mas de 10 dias de antiguedad
- find /var/backups/mariadb -type f -mtime +10 -exec rm {} \;
- # Volcado de bases de datos
- mysqldump --all-databases > /var/backups/mariadb/${timestamp}_all-databases.msql
- # compresion
- gzip /var/backups/mariadb/${timestamp}_all-databases.msql
- # Firmado
- gpg2 --detach-sign \
- --output /var/backups/mariadb/${timestamp}_all-databases.msql.gz.sig \
- /var/backups/mariadb/${timestamp}_all-databases.msql.gz
- # Backup
- rsync -av \
- -e "ssh -i /root/.ssh/id_rsa" \
- /var/backups/mariadb/ \
- backupusr@192.168.0.94:/var/backups/mariadb-$HOSTNAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement