Merge pull request #393 from deveth0/391_verify_backupfiles

#391: Verify if the configured files exist
This commit is contained in:
evilsocket 2019-10-25 11:21:01 +02:00 committed by GitHub
commit 3604f483aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,10 @@ def on_internet_available(agent):
if STATUS.newer_then_days(OPTIONS['interval']):
return
files_to_backup = " ".join(OPTIONS['files'])
# Only backup existing files to prevent errors
existing_files = list(filter(lambda f: os.path.exists(f), OPTIONS['files']))
files_to_backup = " ".join(existing_files)
try:
display = agent.view()