Little python script that remove backup files (configurable through unix shell-style wildcards),
files generated by Makefile
s and automake
.
Requires:
- Python >= 3.0
- Make (optional)
The Script is looking for files and directories match on of the pattern passed over
console arguments or given in a file .tidyup
placed in the directory to by
cleaned up. Is a configure
script and a Makefile
placed in one directory,
make distclean
will be executed. Is in one directory only a Makefile
then
make clean
will be executed.
By default a backup archive will created with the name tidyup.backup.tar.gz
or a name
given in the backup
argument (.tar.gz
will be appended to this name).
In the backup archive all files will be placed that match one of the pattern
(No files removed by make distclean
or make clean
are part of the archive).
Cleanup music directory:
tidyup.py --pattern desktop.ini/Thumbs.db/AlbumArt*.jpg ~/Music
Extract JPEG images and save to ~/images.tar.gz:
tidyup.py --backup ~/images --pattern *.jpg/*.JPG
Remove common backup files without moving to a backup archive:
tidyup.py --no-backup --pattern *~/*.bak
- Merge folder from backup with new one, if it exits already in the backup