Automatic Files Organisation (Intermediate Users)

Tried the final step of dv1sual's post to me above .....

Almost there!

No open your terminal and digit:

cd Downloads

(this will let you enter the Downloads folder where the script is) followed by:

python3 script.py >>~/Downloads/log/log.txt

This piece here:

>>~/Downloads/log/log.txt

Will create a small text file that will register every file the script will move in the right folder. I use it cause i like to have control on what happens but it's not really necessary :slight_smile:
Keep it if you don't mind.

And I got this in the terminal .....

I also tried to use the crontab approach and used namo editor ..... but when I tried to use crontab I get this ....

When I chose ctrl + O I got the photo above ..... but when I choose ctrl + X to exit it does nothing but make a ding sound .... so I had to cancel ..... below photo

Not sure if this means anything or not but I used nano to do the original script above and also to write the crontab ....

Also I called my .py file script.py just to make it simple .... and it is in my /home/mike/Downloads/script.py .....

Yes, to change directory (cd), you must specify the full path. However, the path to HOME is shorthanded to the tilde sign: ~
So you can use

cd ~/Downloads

Also make sure the log directory (folder) has been created.

2 Likes

The log.txt file will be created the first time that the script will move the files in their folders (iirc)
You can try otherwise to just create an empty log.txt file in the log folder you've created.

As @337harvey said, check that you've created it and that it's all lowercase.