/[scripts]/trunk/pgsql-backup-cron.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgsql-backup-cron.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 19 by dpavlin, Wed Jan 25 22:46:56 2006 UTC revision 20 by dpavlin, Fri Jan 27 11:48:19 2006 UTC
# Line 6  function do_dump () { Line 6  function do_dump () {
6          echo -n `date +"%Y-%m-%d %H:%M:%S"` $db_name          echo -n `date +"%Y-%m-%d %H:%M:%S"` $db_name
7          # WARNING: this might be overkill!          # WARNING: this might be overkill!
8          psql -q -c "vacuum full analyze" $1          psql -q -c "vacuum full analyze" $1
9          test ! -d "$dir/$1" && mkdir "$dir/$1" || exit 1          test ! -d "$dir/$1" && ( mkdir "$dir/$1" || exit 1 )
10          file=$dir/$1/`date +%d`.sql.gz          file=$dir/$1/`date +%d`.sql.gz
11          /usr/bin/pg_dump -i $1 | gzip > $file          /usr/bin/pg_dump -i $1 | gzip > $file
12          gzip -l $file | tail -1 | sed 's/  */ /g' | cut -d" " -f-4          gzip -l $file | tail -1 | sed 's/  */ /g' | cut -d" " -f-4

Legend:
Removed from v.19  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26