Last active
October 26, 2024 15:34
-
-
Save zaiddabaeen/6c8a0151370cdd2b5473 to your computer and use it in GitHub Desktop.
This script uses aws-missing-tools to create daily backups (purged after three days) and monthly backups (purged after a month).
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/sh | |
# This script uses aws-missing-tools to create daily backups (purged after three days) and monthly backups (purged after a month). | |
# Run a cronjob daily such as: | |
# 0 4 * * * sh /etc/cron.daily/server-backup.sh >> /var/log/ec2.log 2>&1 | |
# Where server-backup.sh is this script. | |
# Author: Zaid Daba'een | |
DATE=`date +"%d"` | |
VOLUME="vol-abc vol-def vol-qwe" | |
if [ $DATE -eq 1 ]; then | |
sh /usr/local/share/ec2-automate-backup/ec2-automate-backup.sh -v $VOLUME -k 30 -p | |
else | |
sh /usr/local/share/ec2-automate-backup/ec2-automate-backup.sh -v $VOLUME -k 3 -p | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment