Backs up a database and a directory to S3. Each backup run produces a single .full.tar.gz archive containing the database dump and the files tarball, uploaded to both a daily and (on Sundays) a weekly S3 prefix. Status notifications are sent via SNS and a dead man's switch is updated in SSM Parameter Store after every successful run. A companion Lambda function (lambda/dead_mans_switch.py) runs on a schedule and sends an SNS alert if any backup becomes overdue.
-
Clone this repo to the target machine:
git clone https://github.com/felds/s3-backup.git /opt/s3-backup
-
Create an instance script (e.g.
~/backup-myapp.sh) and make it executable:chmod +x ~/backup-myapp.sh -
Schedule it — via cron or systemd — and ensure the machine has the right IAM permissions. See setup for details.