Skip to content

Instantly share code, notes, and snippets.

@simonthompson99
Last active January 13, 2021 12:41
Show Gist options
  • Save simonthompson99/e944d4256f6a270a70b7d24481a9169d to your computer and use it in GitHub Desktop.
Save simonthompson99/e944d4256f6a270a70b7d24481a9169d to your computer and use it in GitHub Desktop.
[Timestamped db dump] Make a timestamped pg_dump of schema in database #sql #bash #database
#!/bin/bash
current_time=$(date "+%Y%m%d-%H%M")
file_name="db_bu_$current_time.sql"
echo $file_name
pg_dump -h 10.1.24.39 -U cdt_user --schema consent_audit metrics > $file_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment