mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-14 17:58:07 +00:00
fix: crontab validation
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
|||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
default_backup_command = ". /env.sh && /backup.sh && rcb cleanup > /proc/1/fd/1 2>&1"
|
default_backup_command = ". /env.sh && /backup.sh && rcb cleanup > /proc/1/fd/1 2>&1"
|
||||||
default_crontab_schedule = "0 2 * * *"
|
default_crontab_schedule = "0 */4 * * *"
|
||||||
|
|
||||||
"""Bag for config values"""
|
"""Bag for config values"""
|
||||||
def __init__(self, check=True):
|
def __init__(self, check=True):
|
||||||
|
|||||||
@@ -34,10 +34,6 @@ def validate_schedule(schedule: str):
|
|||||||
if len(parts) != 5:
|
if len(parts) != 5:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for p in parts:
|
|
||||||
if p != '*' and not p.isdigit():
|
|
||||||
return False
|
|
||||||
|
|
||||||
minute, hour, day, month, weekday = parts
|
minute, hour, day, month, weekday = parts
|
||||||
try:
|
try:
|
||||||
validate_field(minute, 0, 59)
|
validate_field(minute, 0, 59)
|
||||||
|
|||||||
Reference in New Issue
Block a user