Skip to content

Commit

Permalink
bug fix: with rention of backups
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jun 7, 2024
1 parent 2053af5 commit 4510b69
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plogical/IncScheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,14 @@ def startNormalBackups(type):
continue

try:

command = f'find cpbackups -type f -mtime +{destinationConfig["retention"]} -exec rm -f {{}} \\;'
ssh.exec_command(command)
command = f'find cpbackups -type f -mtime +{jobConfig["retention"]} -exec rm -f {{}} \\;'
logging.writeToFile(command)
except:
ssh.exec_command(command)
command = 'find cpbackups -type d -empty -delete'
ssh.exec_command(command)

except BaseException as msg:
logging.writeToFile(f'Failed to delete old backups, Error {str(msg)}')
pass

# Execute the command to create the remote directory
Expand Down

0 comments on commit 4510b69

Please sign in to comment.