bug fix: with rention of backups

This commit is contained in:
usmannasir
2024-06-07 22:37:07 +05:00
parent 5437b57f93
commit 0366c7653b

View File

@@ -657,11 +657,14 @@ Automatic backup failed for %s on %s.
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