- Moves automatically downloaded files into different folders, depending on its extension. It excludes hidden files.
- Detects if a file hasn't completed downloading and waits until it has to move it.
- Creates a log with the timestamp, origin and destination of the file that is being moved.
- Outputs on the console some feedback about what steps it is doing.
- If used with Cron as explained below, it outputs the errors as well, and it's always running in the background.
- When referring to files, same things apply to folders.
- Basic stuff with Python (function, class, tuple, loop)
- File management with Python (writing a log)
- Refreshed my knowledge about Cron
- Python 3 (version 3.8.1 used when creating the script)
- Watchdog package (pip install watchdog)
-
Clone the repository
-
Install Python 3
-
Install pip
-
Create a crontab file
- crontab /Users/sergi/Documents/crontab
-
Add this line to crontab, that will execute automatically the script every time we boot up the OS and throw any errors in a file:
- @reboot cd /Users/sergi/Documents/downloads-automation && ./downloads_automation.sh 2>/Users/sergi/Documents/startup/downloads_automation_error.txt
-
Restart, and enjoy!
App idea taken from Kalle Hallden on his video