Welcome Guest, Not a member yet? Register   Sign In
Add cronjob command line
#3

(This post was last modified: 10-31-2019, 12:51 PM by omid_student.)

(10-31-2019, 12:22 PM)daveĀ friend Wrote: I use a bash script which, on many Linux servers are located at /etc/cron.d/

Code:
#!/bin/sh

cd {CodeIgniter public root folder}
php index.php {controller} {method}

The stuff between the curly brackets needs to be supplied by you. Basically you change directory to where the CI index.php is and then run PHP using the command shown. Substitute the actual controller's and the method's names.

The command in the cron job will be something along these lines

Code:
/etc/cron.d/{name of bash script}

Thank you
Can i use this in Shared Host(Linux)?

(10-31-2019, 12:22 PM)daveĀ friend Wrote: I use a bash script which, on many Linux servers are located at /etc/cron.d/

Code:
#!/bin/sh

cd {CodeIgniter public root folder}
php index.php {controller} {method}

The stuff between the curly brackets needs to be supplied by you. Basically you change directory to where the CI index.php is and then run PHP using the command shown. Substitute the actual controller's and the method's names.

The command in the cron job will be something along these lines

Code:
/etc/cron.d/{name of bash script}
I have access to crontab command but cannot create new job
Reply


Messages In This Thread
Add cronjob command line - by omid_student - 10-31-2019, 11:42 AM
RE: Add cronjob command line - by dave friend - 10-31-2019, 12:22 PM
RE: Add cronjob command line - by omid_student - 10-31-2019, 12:51 PM
RE: Add cronjob command line - by dave friend - 10-31-2019, 04:43 PM
RE: Add cronjob command line - by omid_student - 11-01-2019, 12:24 AM
RE: Add cronjob command line - by omid_student - 11-14-2019, 11:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB