2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-05 12:57:59 +00:00

patch: fix old auto-backup cron jobs

This commit is contained in:
Rohan Bansal 2020-07-06 16:52:09 +05:30
parent 691687edbe
commit e5c3b591f7
2 changed files with 16 additions and 0 deletions

View File

@ -5,3 +5,4 @@ bench.patches.v4.update_node
bench.patches.v4.update_socketio bench.patches.v4.update_socketio
bench.patches.v4.install_yarn #2 bench.patches.v4.install_yarn #2
bench.patches.v5.fix_user_permissions bench.patches.v5.fix_user_permissions
bench.patches.v5.fix_backup_cronjob

View File

@ -0,0 +1,15 @@
from bench.config.common_site_config import get_config
from crontab import CronTab
def execute(bench_path):
"""
This patch fixes a cron job that would backup sites every minute per 6 hours
"""
user = get_config(bench_path=bench_path).get('frappe_user')
user_crontab = CronTab(user=user)
for job in user_crontab.find_comment("bench auto backups set for every 6 hours"):
job.every(6).hours()
user_crontab.write()