Skip to content

plankobostjan/fileCleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 

Repository files navigation

fileCleaner

Program for cleaning files with specific endings.
I've written this program for myself. Fell free to use it.
Some options are added just because of my curiosity.

Warning
I don't guarantee that the program will work for you. I'm also not responsible for the damage (lost files, ...) that this program may cause.

Program does not permanently delete files. It sends them to trash.

First run
When you run the program for the first time, you need to run it with --set-defaults option.

Logs
Program creates a log file (clearLog.txt, same folder where program is located), where the data about deleted files is stored.

Two modes
There are two different modes of the program. By default, data for the program (endings) are stored in text files. But, if you want, you can run program with --database-mode option. If you do so, all the data will be saved in the database. For the database mode, you need to have MariaDB server installed. To create database run python fileCleaner_db.py --create-database.

Options for both modes
-d, --set-defaults => Creates a file (defaults.txt) with preditermined file endigs.
--list-endings => Lists all endings, that are currently saved in endings file (defaults.txt)
--add-endings ENDING ... => Adds endigs you enter to the defaults.txt file.
--remove-endings ENDING ... => Removes endings you enter from defaults.txt file.
--walk FOLDER => Walk thru directory tree, starting in specified folder (default: /home/USER/Downloads) and delete files.

Options specific to non-database mode
-f, --folder FOLDER => Specify folder in wich you want to delete files (default: /home/USER/Downloads/)
--exclude-file FILE ... => Specify files wich will be excluded.

Options specific to the database mode
--add-folders FOLDER ... => Add folders in wich program will look for files to the database.
--list-folders => List all current folders where progam will look for files.
--remove-folders FOLDER ... => Remove specified folders from the database.
--add-excluded-folders FOLDER ... => Add folders where program will not look for files to the database.
--list-excluded-folders => List all excluded folders.
--remove-excluded-folders FOLDER => Remove specified excluded folders from the database.
--add-excluded-folders FILE ... => Add files which won't be searched to the database.
--list-excluded-files => List all excluded files.
--remove-excluded-file FILE => Delete specified files form the database.
--create-database => Create database in wich data will be stored