Forums

TASK PREPARING TO START

Hello, when trying to schedule a task to always be on, I get "Task preparing to start" constantly showing.

chmod +x /home/username/myfolder/myfile.py

Am using the chmod +x as if I don't I get a permission denied signal.

Also, have commented out all print statements.

The file does attempt to save a file and then send it via sftp which works via the console.

chmod +x only changes the execute permission on the file, it does not actually run it. You only need to do the chmod once and after that, the file will be executable. Then you just need to use /home/username/myfolder/myfile.py for your scheduled task.

Ok thanks. Am still really struggling to get this file to run.

When I run the file straight from the console, everything works. However, it throws all sorts of errors when running from say Bash.

"unable to open X server `' error/import.c/ImportImageCommand/364" or "line 8: my_variable: command not found"

I've read through the other posts but am seeing this needs a lot of engineering to get the always on working.

Can you give some pointers here?

Many thanks.

Are you sure you're running in both environments using the same version of Python and with the same virtualenv activated?

I see what you mean. So you have to have a virtual environment installed. I had to put

workon myvenv && python3.6 /home/username/myfolder/myfile.py

This worked. Recommend to put this syntax on the page of the Tasks scheduling. Newbies like me struggle with this stuff.

Thank a lot though for your help. You got me to learn a lot and certainly pointed in the right direction.

Glad we could help! Unfortunately there's a limit to how much we can put there on the Tasks page without it becoming hard to understand, but there's documentation of all of the options on the help page.