Thread: Backups with continuous archiving
Using Postgres 9.0.3 on Solaris 10 (Sparc). I have a few questions concerning hot backups with continuous archiving. We have read and think we understand the Postgres documentation on backup and restore located here: http://www.postgresql.org/docs/9.0/static/continuous-archiving.html
We plan on doing the following
archive mode is on all the time already
1) run pg_start_backup
2) take a filesystem snapshot of data, wal and archive directories
3) run pg_stop_backup
4) tar up the data directory in the snapshot and then delete the data snapshot
5) tar up the archive directory (not the snapshot)
6) tar up the wal directory (not the snapshot)
Here are my questions:
A) CREATING FILESSYSTEM SNAPSHOTS - We're snapping the data, wal and archive directories. We only plan on using the data snap and that's just so we can perform the backup faster. Will the wal and archive snapshots be useful for anything?
B) DELETING THE OLD ARCHIVE LOGS - After you have the data, wal and archive directories tarred up and saved somewhere, how do you manage the deletion of the old archive logs? Do you run a find command and delete based on the age of the file? What the the best way to manage the removal of old archive logs?
We plan on doing the following
archive mode is on all the time already
1) run pg_start_backup
2) take a filesystem snapshot of data, wal and archive directories
3) run pg_stop_backup
4) tar up the data directory in the snapshot and then delete the data snapshot
5) tar up the archive directory (not the snapshot)
6) tar up the wal directory (not the snapshot)
Here are my questions:
A) CREATING FILESSYSTEM SNAPSHOTS - We're snapping the data, wal and archive directories. We only plan on using the data snap and that's just so we can perform the backup faster. Will the wal and archive snapshots be useful for anything?
B) DELETING THE OLD ARCHIVE LOGS - After you have the data, wal and archive directories tarred up and saved somewhere, how do you manage the deletion of the old archive logs? Do you run a find command and delete based on the age of the file? What the the best way to manage the removal of old archive logs?
On Mar 22, 2011, at 5:20 AM, runner wrote: > A) CREATING FILESSYSTEM SNAPSHOTS - We're snapping the data, wal and archive directories. We only plan on using the datasnap and that's just so we can perform the backup faster. Will the wal and archive snapshots be useful for anything? Archived WAL would be require for PITR/to take the Online Backup to Consistent State. You can try: i) pg_start_backup, ii) Snapshot of data Directory, iii) Tar Archived WAL. Snapshot of Archived WAL File should work, however, at the place of using snapshot of Archived WAL Files, I would recommendto use OS Command to backup the WAL Files. > B) DELETING THE OLD ARCHIVE LOGS - After you have the data, wal and archive directories tarred up and saved somewhere,how do you manage the deletion of the old archive logs? Do you run a find command and delete based on the ageof the file? What the the best way to manage the removal of old archive logs? Its totally upto you which method you want to follow. tar command gives an option of deleting of files, after archiving it (--remove-files). Thanks & Regards, Vibhor Kumar Blog:http://vibhork.blogspot.com