NGPriest: Cron Jobs
Ξ December 12th, 2013 | → 0 Comments | ∇ Author: NGPriest |
Cron Jobs
Dear bloggie…?
(You may have seen me using this before…?)
I was asked by a client to send them a daily email (more like spam? :p) and thought cron job would be easiest?
I was planning on using
0 12 * * */home/username/public_html/filename.php
to run the cron job, but ended up with this error
/usr/local/cpanel/bin/jailshell: /home/username/public_html/filename.php: Permission
denied
I read somewhere that i needed to type my username in, so that became attempt 2…?
0 12 * * * username /home/username/public_html/filename.php
And because this post hasn’t finished yet, you guessed it, another error…
/usr/local/cpanel/bin/jailshell: username: command not found
So, back to the drawing board, how do we get the script to run from jailshell?
Let’s try a different approach? Since the script runs using the mail() function, we just need to call the page?
So, our last attempt…
0 12 * * * /usr/bin/wget http://www.client.tld/filename.php
And to test it?
–2013-12-11 10:36:01– http://www.client.tld/filename.php
Resolving www.client.tld… 127.0.0.1
Connecting to www.client.tld|127.0.01|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 270
Saving to: “filename.php”0K 100% 34.7M=0s
2013-12-11 10:36:03 (34.7 MB/s) – “filename.php” saved [270/270]
As for a normal cron job, i’ll still need to look how to work around jailshell… :S
Source Article from http://www.joeylau.me/cron-jobs/