Skip to content

Instantly share code, notes, and snippets.

View changchichung's full-sized avatar

Eric Chang changchichung

  • Taiwan
View GitHub Profile
@changchichung
changchichung / take_database_snapshot.sh
Last active January 16, 2023 07:23 — forked from bahodge/take_database_snapshot.sh
Take a snapshot of your postgres database
#!/usr/bin/bash
# This script will take a snapshot of the database
# It will then gzip it
# It will save it in the 'storage' directory
# it will delete any old db snapshots > 7 days.
echo "===== Starting Snapshot ===="
# add two vars
database_name='test_db'
database_user='test_user'