Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL Old Archive Move Script,

In this tutorial  i written script for how to move postgresql old archive to backup location.

Once If move archive old file to your backup location  ,xlog file will be moved automatically to archive location  so you will get free space in data directory,I faced this issues at the time of dump file restoring.

 cat /script/archive_move_bkp.sh
#!/bin/bash

#####  Script is to take backup of the Archives
PGDATA=/data/
PGHOME=/opt/PostgreSQL/9.3/bin
HOT=/backup
WAL_LOC=/archive/emut_15
LOG=/home/postgres/script_logs
PGDATABASE=postgres
PGUSER=postgres
PGPORT=5432
TODAY=$(date +"%m-%d-%Y-%T")
echo "Archive backup Start Time: `date +%d-%m-%y-%T`" >> $LOG/archiveinfo_$TODAY.log
/opt/PostgreSQL/9.3/bin/psql -U $PGUSER -d $PGDATABASE -p $PGPORT -c "select pg_switch_xlog();" >> $LOG/archiveinfo_$TODAY.log
tar --remove-files -cvzf $HOT/arch18_$TODAY.tar.gz $WAL_LOC/* >> $LOG/archiveinfo_$TODAY.log
echo "Archive backup End Time: `date +%d-%m-%y-%T`" >> $LOG/archiveinfo_$TODAY.log
exit 0



bash-4.1$



Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

How to Configuration UDEV SCSI Rules In Oracle Linux 5, 6 and 7

Linux ctime,mtime,atime,cmin,amin,mmin

aspell