motioneye
asked on
PostgreSQL - How do we run full daily scheduled backup
I'm using Postgresql enterprise db, I wonder how do I run a daily full backups for postgresql and make a removal of old files after 2 weeks ? Is there anyone have the script to complete this task ?
I'm running Postgresql with Redhat Linux
I'm running Postgresql with Redhat Linux
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need all three files -
You can modify the parameter in the backup script to fit your needs -
pg_backup.config - The main configuration file. This should be the only file which needs user modifications.
pg_backup.sh - The normal backup script which will go through each database and save a gzipped and/or a custom format copy of the backup into a date-based directory.
pg_backup_rotated.sh - The same as above except it will delete expired backups based on the configuration.
You can modify the parameter in the backup script to fit your needs -
# Number of days to keep daily backups
DAYS_TO_KEEP=7
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, didnt know wiki have something similar...
Should I create as single file then run as sh or do I have to create 3 different files for each of them