Script I used on servers I manage to backup data files and mysql dump to S3.
No fuss, just works.
pip install awscli
- Create a new s3 or use an existing one.
- Create a new user with access key
- Run
aws configure
to configure access key. This will create a filecredentials
in ~/.aws/ - Copy
config.example
toconfig
and edit to suit your needs - Configure cron job to run this script based on your backup schedule.
Backup files will be saved in the bucket with the following structure.
<s3-bucket-name>/
+-- <server-hostname>/
| +-- data/
| +-- mysql/
+-- <server-hostname>/
+-- data/
+-- mysql/