Forums

Always-on tasks permission denied

Hello, I'm trying to use Always-on tasks but it doesn't start. In the log it's written

"Dec 29 10:33:51 bash: /home/vittus/mysite/webcam.py: Permission denied"

but if I make the file webcam.py run manually it works! Where is my mistake? Thank you!

Is the file exacutable? chmod it to be if it's not.

Thank you for the answer! I'm a bit confused. The file is a .py file, how can I chomd it? I never dit it!

chmod is a Bash command, which allows you to change the permissions on a file -- so,

chmod +x /home/vittus/mysite/webcam.py

Would set the x permission (which is the one to make it executable) on that file.

However, I'd actually recommend a different approach -- instead of making the file itself executable, you can just change the specification of your always-on task to run a Bash command, which will be more flexible. Right now, the command for your task is just

/home/vittus/mysite/webcam.py

If you change it to

python3.9 /home/vittus/mysite/webcam.py

...then that will run your Python script with Python 3.9, and then it should work find without needing to do stuff with file permissions. It will also make it easier to change the Python version used, or to use a virtualenv, should you want to do that in the future.

That's fantastic! Thank you very much, that solved my problem! Happy New Year!

Glad you got that working -- happy New Year to you, too!

hi, I hope you can help me out. I want to run a script file as a task that always stays on.. however, it needs to access another file to filter through which is a cvs file. however, with the task section it just allows one file there..

When I manually "run" this file.. it is able to access this other cvs file but when doing the task. it just runs and accesses one file.

How can I start that main.py task but access the other cvs file?

I don't see any tasks running on your account at the moment. Could you explain what do you mean by "the task section just allows one file"? Or give an example of what you're doing and what you'd like to do?

in the "Add a new always-on task:" section , there is one text field to add a "file pathway" such as "python3.9 /home/username/foler/file.py/" etc,

i have been able to already successfully run a simple task by executing one file in this manner , such as main.py..

In my case, however, like i stated above .. I have another project that my main.py file needs access to another file in my folder to run properly.. it is a cvs file. when the main.py file executeds it filters through the other cvs file. i do not know how to get it to access the other file in the directory.. because you are only allowed to put one file pathway in this section.

I am not sure how to better explain it. I hope you uinderstand.

Thks

When you say "file pathway", do you mean the box for the command near "Run:"? If so, that's the field where you should put the command, it does not have to be a path to single file -- it has to be a syntactically correct Bash command. You can, however, write a script, that would manage any complexity you need for that task, and then use only the path to that script (assuming it can be executed by Bash).

okay, i understand.. yea, i was using it only for the path to that script

Glad we could clear it up.