linuxShortcuts/Services/backup-files.sh

11 lines
292 B
Bash
Raw Normal View History

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