cancel
Showing results for 
Search instead for 
Did you mean: 

Cron Job/Crontab

bomber686
Newbie
Posts: 7
Registered: ‎05-08-2007

Cron Job/Crontab

Hi,
I have uploaded some php scripts to my CCGI webspace and I want to run a couple of cron jobs once a day.  I see cron access seems to be removed due to security risks but I thought you could ask via the question system for a cron job to be installed.  I guess I wasn't clear enough when I asked a question as there was an if in the statment and I was told that once the service is running correctly the support section can't do much more.
Anyway, I wish to run 2 cron jobs once a day. I have poscron.sh which contains:
#!/bin/sh
# $Id: poscron.sh 81 2010-08-12 02:49:35Z frozenice2525 $
#cd ~/your_path_to_tracker
/usr/local/bin/php5 cron_updatepos.php
I'm not sure if I should be asking for cron to run the .sh files or just the .php files and .sh is for when you have command prompt access. If I have to run the .sh files they are:
poscron.sh
postrackercron.sh
or the .php files the above files run are:
cron_updatepos.php
cron_updateallianceinfo.php
cron_updatesov.php
So the code could be:
0 3 * * * ./poscron.sh >> /logs/poscron.log
0 3 * * * ./postrackercron.sh >> /logs/postrackercron.log
or
0 3 * * * ./cron_updatepos.php >> /logs/poscron.log
0 3 * * * ./cron_updateallianceinfo.php >> /logs/postrackercron.log
0 3 * * * ./cron_updatesov.php >> /logs/postrackercron.log
I guess that you can ask for cron to be setup but I have to say run X not if this or that.  Does anyone have experience with running this type of thing and can assist?
4 REPLIES 4
bomber686
Newbie
Posts: 7
Registered: ‎05-08-2007

Re: Cron Job/Crontab

I am now using the path:
0 3 * * * /usr/local/php5/bin /share/storage/04/th/thompson73/cron_updatesov.php >> /logs/cron.log

would this path be correct?  I suppose I could forget about the log pipe if that causes issues.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Cron Job/Crontab

In theory, I think you'd need
0 3 * * * /full/path/to/your/script.cgi >> /full/path/to/your/logfile.log 2>&1
but I'm not sure if PN will actually add new crontab files for users of ccgi.
Do you have space on PAYH? You can set your own cron jobs on there.
Gabe
bomber686
Newbie
Posts: 7
Registered: ‎05-08-2007

Re: Cron Job/Crontab

I have the Extra service.  I don't live in a fibre area so it's just standard ADSL.  There is also no .cgi file to run for the cron.  I had access on another hosting service with cpanel and I was able to setup and test the cron jobs.  I'm at a loss really.  I'm finding it hard to find any hard evidence on setting up cron with plusnet so the only conclusion I can reach is that it cannot be done.
Is the PAYH service an extra you would need to fund? - I see it is an extra, so I guess if you want the usage of cron you have to add the PAYH service.  I don't have it for business purposes, just something I want to do for fun.  I'll just have to live without it I suppose.
Thanks for posting.
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: Cron Job/Crontab

Unfortunately we had to turn SSH access to the CGI platform off some time ago.
If you raise a ticket via the portal we can set up cron jobs for you.