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)