Python-скрипт для видалення старих бекапів через FTP

#!/usr/bin/python

import time
import ftputil

host = ftputil.FTPHost('ftphost', 'ftpuser', 'ftppass')
mypath = ['/', '/dir1', '/dir2', '/dir3', '/dir3',] # директорії з яких видаляти бекапи
now = time.time()

for p in mypath:
    host.chdir(p)
    names = host.listdir(host.curdir)

    for name in names:
        if host.path.getmtime(name) < (now - (7 * 86400)): # 7 днів
            if host.path.isfile(name):
                host.remove(name)


print 'Closing FTP connection'
host.close()