Skip to content

Instantly share code, notes, and snippets.

@zaiddabaeen
Last active January 12, 2016 11:15
Show Gist options
  • Save zaiddabaeen/6c8a0151370cdd2b5473 to your computer and use it in GitHub Desktop.
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).
#!/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 Dabain
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