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:
parent
691687edbe
commit
e5c3b591f7
@ -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
|
||||||
|
15
bench/patches/v5/fix_backup_cronjob.py
Normal file
15
bench/patches/v5/fix_backup_cronjob.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user