Skip to content

Instantly share code, notes, and snippets.

@eercanayar
Last active December 24, 2019 11:05
Show Gist options
  • Save eercanayar/7a20ef8583ba6cceb2dd45191d1a805a to your computer and use it in GitHub Desktop.
Save eercanayar/7a20ef8583ba6cceb2dd45191d1a805a to your computer and use it in GitHub Desktop.
this tiny script creates backups of django sqlite files
#! /bin/bash
now=$(date +%d%m%Y-%H.%M.%S)
filename=db.sqlite3.$now.zip
zip /home/ubuntu/backup-s3/$filename /home/ubuntu/django-prod/db.sqlite3
aws s3 mv /home/ubuntu/backup-s3/$filename s3://django-db-backups
rm /home/ubuntu/backup-s3/$filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment