CRON jobs

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

CRON jobs

Post by cheatboy00 »

I was wondering where i could get more info on these.... i have the capability on my site but i dont know how to use them.....
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

man cron
cron help

Just google it, man
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

Post by cheatboy00 »

heh... thanks again
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

is it true crons don't have to have file extensions?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Well in the *nix world extensions tend not to matter. So yes, cron scripts don't need to have any paticular extension. What will matter is that the script is executeable (chmod u+x, or similar) and that the computer can figure out how to run the file. If its a binary then its straightforward, if its a script file the first line of the file will tell the computer what program to use to interpret the file.

This first line is the
#!/bin/sh or #!/usr/bin/perl or #!/usr/bin/php for (cgi version)
of course people commonly give their scripts .sh, .pl or .php extensions anyways, but its not required and the practice is frowned upon by some.
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

there are some standard locations also.

as in (red hat) linux:

/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly

as said by nielsene, it should have execute permision and the shbang (#!).

regards,
Post Reply