标签:cront usr 执行 日期 tee oca ... bash pre
postgresql定时备份 #!/bin/bash
cur_time=$(date ‘+%Y-%m-%d‘)
ifteendays_time=$(date -d -15days ‘+%Y-%m-%d‘)
rm -rf /var/lib/pgsql/pgsql-backup.$fifteendays_time.dump
echo "Starting Backup PostgreSQL ..."
/usr/local/postgresql/bin/pg_dumpall -U postgres -p 3433 > /var/lib/pgsql/"pgsql-backup.$cur_time.dump"
echo "Finish Backup ..."
#chmod 755 /var/lib/pgsql/back.up
#su - postgres
00 4 * * * /var/lib/pgsql/backup.sh
标签:cront usr 执行 日期 tee oca ... bash pre
原文地址:http://blog.51cto.com/13889476/2174249