From 4a0d4abc547e960d22cb3504f7c81acf902b68ad Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 5 Aug 2019 01:24:39 -0700 Subject: [PATCH] After successful full backup, delete the entire diff backup directory, since it should technically all be out of date --- mikes-backup | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mikes-backup b/mikes-backup index a4d3615..6de1eeb 100755 --- a/mikes-backup +++ b/mikes-backup @@ -334,7 +334,7 @@ class MikesBackup: self.log("Automatically choosing full backup, because full backup destination directory wasn't found") self.do_full_backup() - # TODO: Full backups should clean out the differentials directory + # def do_full_backup(self): # Start args @@ -354,6 +354,16 @@ class MikesBackup: self.log("Destination dir:" + destination_dir) self.execute_rsync(args) + + self.log("Rsync seems to have finished successfully") + self.log("Because a full backup has succeeded, will now delete any differential backups") + self.execute_remote_ssh_command( + [ + "rm", + "-rfv", + self.make_remote_differential_backup_path_base() + ]) + self.log("Finished deleting old differentials") # def do_differential_backup(self):