Skip to content

Commit 4510b69

Browse files
committed
bug fix: with rention of backups
1 parent 2053af5 commit 4510b69

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

plogical/IncScheduler.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,14 @@ def startNormalBackups(type):
657657
continue
658658

659659
try:
660-
661-
command = f'find cpbackups -type f -mtime +{destinationConfig["retention"]} -exec rm -f {{}} \\;'
662-
ssh.exec_command(command)
660+
command = f'find cpbackups -type f -mtime +{jobConfig["retention"]} -exec rm -f {{}} \\;'
663661
logging.writeToFile(command)
664-
except:
662+
ssh.exec_command(command)
663+
command = 'find cpbackups -type d -empty -delete'
664+
ssh.exec_command(command)
665+
666+
except BaseException as msg:
667+
logging.writeToFile(f'Failed to delete old backups, Error {str(msg)}')
665668
pass
666669

667670
# Execute the command to create the remote directory

0 commit comments

Comments
 (0)