Browse Source

make files deleted properly

master
Christian Urich 5 years ago
parent
commit
f6369520c6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      backup.py

+ 2
- 2
backup.py View File

@ -20,7 +20,7 @@ def main():
print('deleting local files older than {}days in {}'.format( print('deleting local files older than {}days in {}'.format(
backup_local_age, backup_dir backup_local_age, backup_dir
)) ))
cmd = 'find {} -mindepth 1 -mtime +{} -delete'.format(
cmd = 'find {} -type f -mtime +{} -delete'.format(
backup_dir, backup_local_age backup_dir, backup_local_age
) )
print('({})'.format(cmd)) print('({})'.format(cmd))
@ -30,7 +30,7 @@ def main():
backup_dir) backup_dir)
print('({})'.format(cmd)) print('({})'.format(cmd))
os.system(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) host, hosts[host][service], backup_server_age)
print('({})'.format(cmd)) print('({})'.format(cmd))
os.system(cmd) os.system(cmd)


Loading…
Cancel
Save