In my BASH script, backup.sh, I have:
TIMEATSTART=$(date +%Y-%m-%d-%s) DIRECTORY_ARC=$USER_HOME/archive FILENAME_DBBACKUP=db-$TIMEATSTART.gz export PGPASSWORD=dbpassword pg_dump -U dbuser database_name | gzip -c > $DIRECTORY_ARC/$FILENAME_DBBACKUPThe script makes a convenient backup of my database_name database to an archive/db-00000000000.gz file in my home directory.
No comments:
Post a Comment