Skip to content

Commit 5f30236

Browse files
committed
pre-flight checks not needed in scheduled mode. stop windows cmd-window appearing every 15mins.
1 parent ec4f130 commit 5f30236

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

kopia-start-backups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ def main():
429429
logging.error(f"No matching repositories found for: {args.repo}")
430430
sys.exit(1)
431431

432-
# Perform pre-flight checks (unless skipped or just registering)
433-
if not args.skip_preflight and not args.register:
432+
# Perform pre-flight checks (unless skipped, registering, or scheduled mode)
433+
if not args.skip_preflight and not args.register and not args.scheduled:
434434
preflight_ok, preflight_errors = preflight_checks(config, runner)
435435
if not preflight_ok:
436436
print("\n" + "="*60, file=sys.stderr)

kopia_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,14 @@ def check_remote_configured(self, remote_name: str) -> bool:
784784
True if remote is configured, False otherwise.
785785
"""
786786
try:
787+
# CREATE_NO_WINDOW prevents console popup on Windows during scheduled runs
788+
creation_flags = 0x08000000 if sys.platform == "win32" else 0
787789
result = subprocess.run(
788790
[RCLONE_EXE, "listremotes"],
789791
capture_output=True,
790792
text=True,
791-
encoding='utf-8'
793+
encoding='utf-8',
794+
creationflags=creation_flags
792795
)
793796
if result.returncode != 0:
794797
return False

0 commit comments

Comments
 (0)