Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def backup(min_interval=MIN_INTERVAL, backup_dir=BACKUP_DIR, data_dir=DATA_DIR):
if backup_dir is None:
return
#XXX: The timeout is arbitrary but dependent on the back-up, should we start
# with a sane default and then refer to how long the last back-up
# took?
backup_lock = join_path(DATA_DIR, '.backup.lock')
with file_lock(backup_lock, pid_policy=PID_WARN, timeout=60):
_backup(min_interval, backup_dir, data_dir)