Cron - Maintenance Tasks
My site is running on a UNIX web server. Through cPanel I have set up a "standard" cron job but the command line above does not seem to produce cron output. Are modifications need to the command line for Unix/standard cron job?
My server produces the following message when the command line above is run:
/bin/sh:http://www.domainname.com/index.php/tools/required/jobs?auth=bdc1b5... No such file or directory
chmod +x file.sh also works with files and not urls.
you need a tool that sends a http request.
which downloads the output..
but you can also use php instead of sh to execute a script. Create a script on your local server which is executable, like this:
#!/usr/bin/php <?php readfile('http://sdfsdf'); ?>
You can try the following command:
But wget needs to be installed on your server. If not you, you have to use another command line tool or write some script and execute that.
25 */2 * * * /usr/bin/wget -t 1 -q -O -http://blah.com/index.php/tools/required/jobs?auth=7890......
This runs the maintenance tasks every other hour at twenty-five after.
wget: missing URL
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
I'm not sure I understand what the number '1' is for the command above the --help doc doesn't help much either. UPDATE: the number is for the '-t' option setting the number of retries.
Works beautifully and it's free. Plus, it's nice to know I don't have rely on setting up a cron. Although it would be a nice option.
I also like to put my url in quotes
Should look like:
25 */2 * * * /usr/bin/wget -t 1 -q -O - "http://blah.com/index.php/tools/required/jobs?auth=7890......"
/usr/bin/wget -t 1 -q -O - "http://blah.com/index.php/tools/required/jobs?auth=3245cf43c..."
Works at running Scheduled Jobs for c5 in CPanel.