Your support is greatly appreciated and will help ensure the project's continued development and improvement. Thank you for being a part of the community!
- LTC:
LPV7EqTdEYjnFsBwaCtKuAB2XajMgxEh82
- USDT (BEP20):
0x4603b2b4e2f2a699cb7a65f6f564bbd5b91970cd
- USDT (TRC20):
TGMQjS7HHwXTtLdpgYdHc2GZZGEcGLrhca
The File Classifier is a Python script that monitors a specified directory (typically the Downloads folder) and automatically organizes files into different folders based on their file types and the date they were created or last modified. It can also identify and delete duplicate files.
To run the File Classifier, you need:
- Python 3.6 or later
- The watchdog package for monitoring the directory
You can install the watchdog package using the following command:
pip install watchdog
Download the main script file main.py
and the configuration file config.py
.
Open the config.py
file and modify the download_folder variable to the path of the directory you want to monitor (e.g., your Downloads folder).
In the same file, you can also modify the classification_rules dictionary to customize the folders and file types used for classification. The key is the folder name, and the value is a list of file extensions.
Optionally, you can customize the GREEN and RESET variables in config.py
to change the color of the printed messages.
Open a terminal or command prompt, navigate to the folder containing the main.py
and config.py
files.
Run the script using the following command:
python main.py
The script will start monitoring the specified directory. When a new file is added or an existing file is modified, the script will automatically move the file to the appropriate folder based on its file type and date.
If a duplicate file is detected, the script will delete it, provided that it has the same name as the original file plus a number in parentheses (e.g., "invoice (1).pdf").
To stop the script, press Ctrl+C
.
To use bash command to run the script, first make sure that the Python script file main.py
is executable.
You can do this by running the following command in your terminal:
chmod +x main.py
Also, make the bash script executable by running:
chmod +x start.sh
-
To add more file types or folders for classification, edit the classification_rules dictionary in the
config.py
file. -
To change the date format used for organizing files, modify the strftime format string in the get_date_folder function within the
main.py
file.
To run the script at startup on Ubuntu, you have a few options.
One common approach is to add an entry to the "Startup Applications" tool:
- Open the "Startup Applications" tool by searching for it in the Activities overview or running
gnome-session-properties
in the terminal. - Click the "Add" button.
- Fill in the "Name" field (e.g., "Start File Classifier").
- In the "Command" field, enter the full path to the start_services.sh script (e.g.,
/home/YOUR_USERNAME/path/to/script/start.sh
). - Click "Add" and close the "Startup Applications" tool.
Now, the bash script will run automatically when you log in to your Ubuntu system.
Note: Please note that this approach will only work when you log in with a graphical environment, as it relies on the GNOME startup applications feature. If you need to run the script in a non-GUI environment or before user login, you may need to use a different method, such as a systemd service or a cron job.
-
File size-based classification: Classify files based on their size (e.g., create separate folders for small, medium, and large files) in addition to their file type.
-
Date-based classification:
Organize files into folders based on the date they were created or last modified. -
File content-based classification: For specific file types, such as text files or code files, classify them based on their content (e.g., programming language, presence of specific keywords).
-
User-defined classification: Allow users to define their own custom classification rules, such as regular expressions or other matching criteria, to create a more personalized organization system.
-
Logging:
Keep a log of all actions performed by the script, such as files moved or deleted, for better traceability and understanding of the changes made. -
Undo functionality: Implement an undo feature that allows users to revert the script's actions if they accidentally move or delete a file.
-
Automatic folder cleanup:
Periodically check the folders for old files and either move them to an archive folder or delete them based on user preferences. -
Notifications: Send notifications to the user when certain events occur, such as the creation of new files or the detection of duplicate files.
-
File integrity check: Perform a file integrity check (e.g., using checksums) to ensure that duplicate files are not only similar in name but also identical in content before deleting them.
-
GUI: Develop a graphical user interface (GUI) for the script, making it more user-friendly and easier to configure and monitor.
If you find this script helpful and would like to support its development and maintenance, please consider the following options:
-
Star the repository: If you're using this script from a GitHub repository, please give the project a star on GitHub. This helps others discover the project and shows your appreciation for the work done.
-
Share your feedback: Your feedback, suggestions, and feature requests are invaluable to the project's growth. Please open issues on the GitHub repository or contact the author directly to provide your input.
-
Contribute: You can contribute to the project by submitting pull requests with bug fixes, improvements, or new features. Make sure to follow the project's coding style and guidelines when making changes.
-
Spread the word: Share the project with your friends, colleagues, and social media networks to help others benefit from the script as well.
-
Donate: Show your appreciation with a small donation. Your support will help me maintain and enhance the script. Every little bit helps, and your donation will make a big difference in my ability to keep this project alive and thriving.
- LTC:
LPV7EqTdEYjnFsBwaCtKuAB2XajMgxEh82
- USDT (BEP20):
0x4603b2b4e2f2a699cb7a65f6f564bbd5b91970cd
- USDT (TRC20):
TGMQjS7HHwXTtLdpgYdHc2GZZGEcGLrhca
Your support is greatly appreciated and will help ensure the project's continued development and improvement. Thank you for being a part of the community!
This project is licensed under the MIT License.