Page 1 of 1

how to set up a cron job

Posted: Thu Sep 29, 2005 9:44 pm
by Charles256
erm.can't seem to search properly:-/ How do you set up a cron job if there isn't an option on my vdeck?is there any way to code one?if so where? i'm on a shaerd server.

Posted: Thu Sep 29, 2005 10:24 pm
by neophyte
Shell access will do it. :roll: But you probably don't have that. Call support. That's what I would do...

Posted: Fri Sep 30, 2005 9:54 am
by pickle
Sometimes your account control panel can give you access to cron. If you have to get support to set it up, I'd suggest you ask them to just make a cron job for a control file of yours. You can then use that control file to call other files depending on the time. That way, if you want to add more cron jobs, you just modify the control file, rather than talking to support again.

Posted: Fri Sep 30, 2005 11:17 am
by Charles256
control file you say? and how is a control file structured? I've never used a cron before, I'm wanting to do some research into how crons work and I find hands on experience works best,hence my original question. :)

Posted: Fri Sep 30, 2005 11:41 am
by pickle
"Control File" was just my terminology. There's no sense me going further into what I meant unless you need to talk to support to get your cron job going.

Do you have shell access?

Posted: Fri Sep 30, 2005 11:43 am
by Charles256
nopers :-/

Posted: Fri Sep 30, 2005 12:59 pm
by pickle
If you don't have shell access, then you've really only got two options.

The first option is to talk to support and see if they can set up a cron job for you. If you do this, then I'm back to suggesting you use (what I called) a control file. What I'd suggest is get support to run your file (say: example.php) every 10 minutes. Then, in example.php, you check the time and depending on the actual time, you run particular files - essentially your own copy of cron.

The second option is to tie in whatever you want cronned into the template of your website (if this isn't for a website, this might not work). So, you could just run whatever you wanted cronned, on the first page load of the hour. This'll make the first page load a bit slower, and won't guarantee you get your stuff done every hour on the hour, but you might not have a choice if support can't/won't set up a cron job for you.

Posted: Fri Sep 30, 2005 1:05 pm
by Charles256
i like that first option.i'll call support when i get home,thanks.