diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2025-08-05 02:03:01 +0100 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2025-08-05 02:03:01 +0100 | 
| commit | 471ab1f35aaf9651926431198bc59f3b73a1b7df (patch) | |
| tree | 3da328a4fe44c61d52ea322f266b64013d49c216 /autoBackup | |
| parent | 77cac0122b104e17000b41cfe811e12cb2cd4d8f (diff) | |
| download | BetterZFSReplication-471ab1f35aaf9651926431198bc59f3b73a1b7df.tar.gz BetterZFSReplication-471ab1f35aaf9651926431198bc59f3b73a1b7df.zip | |
Fixed bug with removing files
Diffstat (limited to 'autoBackup')
| -rw-r--r-- | autoBackup/autoBackup.py | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/autoBackup/autoBackup.py b/autoBackup/autoBackup.py index 5466926..cbb6392 100644 --- a/autoBackup/autoBackup.py +++ b/autoBackup/autoBackup.py @@ -134,8 +134,11 @@ class TrueNASWebsocketsClient(truenas_api_client.JSONRPCClient):                  ))          if all_complete: -            os.remove(self._get_job_serialized_name(job_type)) -            logging.info("No more running %s jobs on '%s'" % (job_type, self.host)) +            if os.path.exists(self._get_job_serialized_name(job_type)): +                os.remove(self._get_job_serialized_name(job_type)) +                logging.info("All %s jobs on '%s' completed" % (job_type, self.host)) +            else: +                logging.info("There were no %s jobs on '%s'. Perhaps they already all finished." % (job_type, self.host))          return all_complete  class TrueNASAPIClient: | 
