Divi WordPress Theme

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

Topic: How Do I execute a .sh script using cpanel cron job  (Read 1880 times)

Offline Chris

  • Junior Guru
  • **
  • Posts: 81
  • iTrader: +0/-0
    • View Profile
How Do I execute a .sh script using cpanel cron job
« on: October 31, 2019, 11:47:33 AM »
I am new to command line so please forgive my ignorance. I can successfully execute my script using SSH by navigating to the relevant directory and typing following command:

    bash myscript.sh

I’m now trying to set this script to run using cPanel cron job. I have tried the following but it doesn’t work:

    * * * * * /public_html/app/cron_jobs/myscript.sh

Any help would be appreciated..
VPS Hosting - AccuWebHosting

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 660
  • iTrader: +153/-0
    • View Profile
Re: How Do I execute a .sh script using cpanel cron job
« Reply #1 on: October 31, 2019, 11:48:33 AM »
First, you will have to make sure that your script has execute permissions and then set following cron:

0 * * * * /home/<your_user>/public_html/yourscript.sh

Adjust time as per your need.
Shopify Divi WordPress Theme
Tags:

Execute ASP code on HTM or HTML file

Started by KailashBoard How Tos

Replies: 0
Views: 7656
Last post January 10, 2007, 02:31:38 PM
by Kailash
send mail using SMTP authentication :: phpmailer script

Started by KailashBoard PHP

Replies: 0
Views: 14656
Last post February 04, 2007, 01:42:44 PM
by Kailash
Disable catch all / default email address in cPanel / WHM

Started by KailashBoard cPanel/WHM

Replies: 0
Views: 12848
Last post July 21, 2009, 10:27:35 AM
by Kailash
cPanel Training Seminar 2007

Started by KailashBoard Other Web Hosting Stuff

Replies: 0
Views: 3496
Last post April 29, 2007, 11:35:37 PM
by Kailash
cPanel and WHM version 11 released

Started by KailashBoard Other Web Hosting Stuff

Replies: 1
Views: 4071
Last post July 01, 2007, 02:05:54 PM
by Kailash