首页 > 代码库 > Odoo Auto Backup Database And Set Linux task schedualer
Odoo Auto Backup Database And Set Linux task schedualer
First ,Write Database Backup Script:
pg_dump -Fc yourdatabasename > /home/yourfilepath/yourdatabasename$(data+%Y-%m-%d).dump
Save it as a file name dump.sh
su root user,and set schedualer job:
crontab -e
set every day 3:00 am auto backup database:
00 3 * * * su - postgres /home/dump.sh >> /var/log/cron.pgsql.log 2>&1
if needed, set auto delete database file 10days before:
00 5 * * * find /home/db_backup -name ‘*.dump‘ -mtime +10 -exec rm "{}" \;
at last,restart cron service:
sudo service cron restart
Odoo Auto Backup Database And Set Linux task schedualer
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。