mirror of
https://github.com/netinvent/npbackup.git
synced 2025-02-24 22:44:04 +08:00
Make sure bogus interval is catched
This commit is contained in:
parent
9da3db199e
commit
3d12b669e1
1 changed files with 7 additions and 1 deletions
|
@ -7,7 +7,7 @@ __intname__ = "npbackup.windows.task"
|
|||
__author__ = "Orsiris de Jong"
|
||||
__copyright__ = "Copyright (C) 2022-2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "2023012101"
|
||||
__build__ = "2023020201"
|
||||
|
||||
|
||||
import sys
|
||||
|
@ -38,6 +38,12 @@ def create_scheduled_task(executable_path, interval_minutes: int):
|
|||
logger.error("Can only create a scheduled task on Windows")
|
||||
return False
|
||||
|
||||
try:
|
||||
interval_minutes = int(interval_minutes)
|
||||
except ValueError:
|
||||
logger.error("Bogus interval given")
|
||||
return False
|
||||
|
||||
executable_dir = os.path.dirname(executable_path)
|
||||
|
||||
SCHEDULED_TASK_FILE_CONTENT = """<?xml version="1.0" encoding="UTF-16"?>
|
||||
|
|
Loading…
Reference in a new issue