-
-
Save qa1/9660daac0674a9b5fbce39cdd20c3198 to your computer and use it in GitHub Desktop.
Create a backup and Delete old backups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tar -zcf /backups/backup-$(date +%Y%m%d).tar.gz --absolute-names /data | |
rm -f /backups/backup-$(date -d 'now - 7 days' +%Y%m%d).tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment