From f6369520c60eb3c740f5a97c4b360cf77ca9bda1 Mon Sep 17 00:00:00 2001 From: Christian Urich Date: Mon, 19 Apr 2021 21:32:23 +0200 Subject: [PATCH] make files deleted properly --- backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup.py b/backup.py index e2a4fc4..9fde8f9 100644 --- a/backup.py +++ b/backup.py @@ -20,7 +20,7 @@ def main(): print('deleting local files older than {}days in {}'.format( backup_local_age, backup_dir )) - cmd = 'find {} -mindepth 1 -mtime +{} -delete'.format( + cmd = 'find {} -type f -mtime +{} -delete'.format( backup_dir, backup_local_age ) print('({})'.format(cmd)) @@ -30,7 +30,7 @@ def main(): backup_dir) print('({})'.format(cmd)) os.system(cmd) - cmd = 'ssh {} "find {} -mindepth 1 -mtime +{} -delete"'.format( + cmd = 'ssh {} "find {} -type f -mtime +{} -delete"'.format( host, hosts[host][service], backup_server_age) print('({})'.format(cmd)) os.system(cmd)