0.0
No commit activity in last 3 years
No release in over 3 years
Executable to delete files which fit certain criteria e.g. you can delete files older than 1 month keeping one weekly file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3

Runtime

 Project Readme

Synopsis¶ ↑

Executable to delete files fitting certain criteria.

The intended purpose is to delete backups older than a certain date, whilst keeping hourly, daily or weekly and so on backups.

Specifying an option like –hourly will keep the first file of the hour and delete the rest of the files created within the same hour, provided that the those files were created before the threshold date.

The executable does not itself create any backups, it is only intended for cleaning up existing ones.

Usage¶ ↑

clean_files file_paths [options]

For help use: clean_files -h

Options¶ ↑

-v, --verbose     Print name of files deleted
-p, --pretend     Implies -v, only prints what files would have been deleted
-r, --recursive   Delete directories as well as files
-t, --threshold   Time ago in days for when to start deleting files
                  File newer than this date are never deleted.
                  The default is 30 days.

                  For example:

                 -t 10 or --threshold=30

-H, --hourly      Keep hourly files
-D, --daily       Keep daily files
-W, --weekly      Keep weekly files
-M, --monthly     Keep monthly files
-Y, --yearly      Keep yearly files

Examples¶ ↑

clean_files /backups/sql/*.sql --threshold 60 --daily
clean_files /Users/me/Downloads/* --pretend --verbose --recursive -t 10

Copyright © 2009 AlphaSights Ltd. See LICENSE for details.