postgre数据库备份恢复shell

#!/bin/sh
#td=`date +"%Y%m%d%H%M%S" `
#echo $td
dbname='test'
#backupname=$td.$dbname.dump
#su postgres -c "/usr/local/carlink/postgresql/bin/pg_dump $dbname > /usr/local/carlink/dbbackup/databak/"$backupname
#su postgres -c "/usr/local/carlink/postgresql/bin/pg_dump -i -h 192.168.1.208 -p 5432 -U postgres  -F c -b -v -f /usr/local/carlink/dbbackup/databak/"$backupname test

su postgres -c "/usr/local/carlink/postgresql/bin/psql $dbname < /usr/local/carlink/dbbackup/databak/${1}"
exit
 

你可能感兴趣的:(技术空间)