Revisions
-
spike grobstein revised this gist
Apr 30, 2012 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,13 @@ ## postgres_backup ## back up postgres on a regular basis ## USAGE: ## ./postgres_backup [ <prefix> ] [ <number_to_keep> ] ## prefix will default to 'pg' ## number_to_keep defaults to 2 ## ## Creates a backup in the form of <prefix>_<number> ## Number to keep is the number of backups to keep (still not implemented.) ## ## convention says you should use 'd' for daily backups and 'h' for hourly backups. ## example (for hourly): ## ./postgres_backup h -
spike grobstein renamed this gist
Apr 30, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
spike grobstein revised this gist
Apr 30, 2012 . 1 changed file with 33 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,33 @@ #! /bin/bash - #### ## postgres_backup ## back up postgres on a regular basis ## USAGE: ## ./postgres_backup [ <prefix> ] ## prefix will default to 'pg' ## convention says you should use 'd' for daily backups and 'h' for hourly backups. ## example (for hourly): ## ./postgres_backup h ## example (for daily): ## ./postgres_backup d #### # initialize some variables BACKUP_DIR="/var/postgres/backup/" DATABASE="exchange_prod" ENCODING="SQL_ASCII" PG_DUMP="/usr/bin/pg_dump" PREFIX="${1:-pg}" # default to 'pg' for prefix cd "$BACKUP_DIR" # clean up rm -f "${PREFIX}_2" || true mv "${PREFIX}_1" "${PREFIX}_2" # do backup! $PG_DUMP -E${ENCODING} -Upostgres -Fc -f"${PREFIX}_1" "$DATABASE" \ || { echo "Errors occurred when backing up. OH NO." 2>&1; exit 1; } -
Robert Sosinski created this gist
Apr 30, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ #!/bin/bash