mirror of
https://github.com/netinvent/npbackup.git
synced 2024-11-10 17:15:28 +08:00
CLI: Make task creation explicit
This commit is contained in:
parent
2033f40aa2
commit
3de7872845
1 changed files with 2 additions and 1 deletions
|
@ -111,11 +111,12 @@ def create_scheduled_task_unix(
|
|||
f'{trigger} cd "{executable_dir}" && {cli_executable_path} {TASK_ARGS}\n'
|
||||
)
|
||||
try:
|
||||
with open("/etc/cron.d/npbackup", "w") as file_handle:
|
||||
with open(cron_file, "w") as file_handle:
|
||||
file_handle.write(crontab_entry)
|
||||
except OSError as exc:
|
||||
logger.error("Could not write to file {}: {}".format(cron_file, exc))
|
||||
return False
|
||||
logger.info("Task created successfully as {cron_file}")
|
||||
return True
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue