Skip to content

Latest commit

 

History

History
 
 

ftp-tools

Some simple FTP tools.

delete_old_files.py

Cleanup a FTP Server by deleting the files which are older than X days.

usage: delete_old_files.py [-h] [-v] [-p PATH] [--verbosity {0,1,2}]
                           [--dryrun] [--info]
                           [-d {7,8,9,10,11,12,13,14,15,16,17,18,19}]
                           host username password

Cleanup a FTP Server by deleting the files which are older than X days.

positional arguments:
  host                  FTP server address, e.g.: ftp.domain.tld
  username              FTP user name
  password              FTP password

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -p PATH, --path PATH  root path to start the tree walk
  --verbosity {0,1,2}   increase output verbosity
  --dryrun              run but don't make any changes
  --info                Display only information about the files on the FTP
                        (Don't delete anything)
  -d {7,8,9,10,11,12,13,14,15,16,17,18,19}, --days {7,8,9,10,11,12,13,14,15,16,17,18,19}
                        how many days must a file be old for delete?

(run python delete_old_files.py -h for current arguments/parameters.)

Notes

  • It's not a clean implementation
  • specialised for a MS FTP Server
  • intended for execution under windows
  • min. Python 2.7 needed

DoTo

  • merge duplicated code parts
  • code cleanup

History

  • v0.0.1 - add a CLI
  • v0.0.0 - Initial checkin