How Do I execute a .sh script using cpanel cron job
Asked Answered
U

2

5

Im very new to command line so please forgive my ignorance. I can succesfully execute my script using putty by navigating to the relevant direcotry and typing

bash app_auth.sh

I'm now trying to set this scipt to run using cPanel cron job. I have tried the following but it doesnt work:

*   *   *   *   *   /public_html/app/cron_jobs/app_auth.sh  

Any help would be appreciated..

Underlinen answered 28/6, 2012 at 11:25 Comment(0)
S
5

Though this thread is old but I found it unanswered hence replying.

Make sure that you have assigned execute permissions to your app_auth.sh file. Also, try setting the following cron:

* * * * * /public_html/app/cron_jobs/app_auth.sh > /home/YOUR_USER/cron.log 2>&1
Scabies answered 21/6, 2013 at 6:17 Comment(0)
G
5

Just for the record, I came across the same problem.

I found this webpage, which led me to do this:

/bin/sh /public_html/app/cron_jobs/app_auth.sh

And it worked fine!

Grown answered 1/6, 2016 at 14:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.