copy (select * from schema_name.table_name where crt_time>=$date) to '/home/postgres/tbl.bak'"
psql -d db_kenyon -c"copy (select * from schema_name.table_name where id>=$id) to '/home/postgres/tbl.bak'"
4.crontab定时调度
50 1 * * * sh /home/postgres/script/DB_backup.sh >> /home/postgres/backup/backup.log 2>&1
5.说明
上述脚本相对简单,还可以加入其它一些异常判断和邮件发送等。