Need help with crontab

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
JacksonS
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat May 22, 2021 3:33 pm

Need help with crontab

Post by JacksonS »

hello, im trying to set up a crontab that would run every minute but i keep getting permission denied and im not sure what i have done wrong
this is what it sends my email v
"/bin/sh: /usr/www/[username]/public/[folder]/[folder]/[whatiwanttorun.php]: Permission denied"
and this is what i have in crontab v
"* * * * * ~/public/[folder]/[folder]/[whatiwanttorun.php]"
would anyone be able to help me?
User avatar
hiimcody1
Staff
Staff
Posts: 1593
Joined: Wed Dec 28, 2011 4:59 pm

Re: Need help with crontab

Post by hiimcody1 »

Is the PHP file designed to be run from the CLI and not the browser? If so, all you should need to do is change the line to this:

Code: Select all

* * * * * /usr/bin/php -q ~/public/[folder]/[folder]/[whatiwanttorun.php]
Having "/usr/bin/php -q" in front of the script will execute it through PHP.
JacksonS
New to forums
New to forums
Posts: 2
Joined: Sat May 22, 2021 3:33 pm

Re: Need help with crontab

Post by JacksonS »

ah didnt know that but thank you, it works now
User avatar
hiimcody1
Staff
Staff
Posts: 1593
Joined: Wed Dec 28, 2011 4:59 pm

Re: Need help with crontab

Post by hiimcody1 »

No problem.

Take care!
Post Reply