Search Postgresql Archives

Re: [ADMIN] PITR - base backup question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Richard,

This means a file systems backup. eg.

tar -cvpf data_bakup.tar /var/lib/pgsql/data



Here's a script I use to automate this process. It may be helpful to
customize for yourself.

#!/bin/bash
#
# PostgreSQL Weekly Backup
#

DATE=$(date +%G%m%d)
MAILLOG="/backup/weekly_$DATE.log"
WALARCH="/pgbackup"
DESTINATION="X.X.X.X::rsyncshare/"
EMAILDEST=""

touch $MAILLOG
echo -e "::::::::::::::: $DATE Pallas1 Weekly WAL Backup :::::::::::::::"
>> $MAILLOG

psql -U postgres -c "select pg_start_backup ('$DATE');"

cd  /var/lib/pgsql
tar -cvpzf "pgbackup_$DATE.tar.gz" data/ >> $MAILLOG 2>&1

psql -U postgres -c "select pg_stop_backup ();"

find $WALARCH -perm 600 -mmin "+360" -exec rm {} \; >> $MAILLOG 2>&1
find $WALARCH/data_dir_backup -mtime "+5" -exec rm {} \; >> $MAILLOG 2>&1

ls -la $WALARCH >> $MAILLOG 2>&1

mv /var/lib/pgsql/pgbackup_$DATE.tar.gz /$WALARCH/data_dir_backup/.

rsync -a -v -v --progress --stats --delete "/$WALARCH" $DESTINATION >>
$MAILLOG 2>&1

/bin/cat $MAILLOG | mail -s "Weekly WAL Backup - Successful" $EMAILDEST &&
rm $MAILLOG





On Tue, 26 Aug 2008 15:53:33 -0700, "Richard Broersma"
<richard.broersma@xxxxxxxxx> wrote:
> From the following link:
>
http://www.postgresql.org/docs/8.3/interactive/continuous-archiving.html#BACKUP-BASE-BACKUP
> 
> Step 3 says to perform the back up.
> 
>     Does this mean a File System Backup of the Data directory?
> OR
>     Does this mean performing a pg_dumpall and backing up the dump file?
> 
> -- 
> Regards,
> Richard Broersma Jr.
> 
> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> http://pugs.postgresql.org/lapug
> 
>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux