linuxShortcuts/Services/backup-db.sh

10 lines
279 B
Bash
Raw Normal View History

2019-07-15 16:30:28 +00:00
#! /bin/bash
sshKey=$(<.sshKey)
serverBackupPath=$(<.serverBackupPath)
localPath=$(<.localBackupPath)
/bin/rsync -r -e "ssh -i $sshKey" "$serverBackupPath/db/*" "$localPath/db/"
# Delete files older than 15 days
find "$localPath/db" -type f -name "*.sql.gz" -mtime +15 -delete