Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vcron
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Fri Jan 17, 2003 11:55 am    Post subject: vcron Reply with quote

Soo.... Can anybody give me a good discription of how to use cron? ;)

The man page for vcron is.... lacking, to say the least.

I swear there used to be a doc on using cron in gentoo... But I can't find it.
Back to top
View user's profile Send private message
tukem
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2002
Posts: 114
Location: Tampere, Finland

PostPosted: Fri Jan 17, 2003 7:45 pm    Post subject: Reply with quote

I don't what kind of information you were looking for but I think "man 5 crontab" gives fairly decent information on the usage.
Back to top
View user's profile Send private message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Fri Jan 17, 2003 11:58 pm    Post subject: Reply with quote

Ok... that helps a little... Most of that stuff I had found out though.
And for as long as I've used linux it's surprising that I've never figured out putting the number in the man statement to get the different man page if there is more than one until now ;)

Okay, what I can't seem to figure out is... What is the whole cron.daily cron.hourly stuff?
Back to top
View user's profile Send private message
tukem
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2002
Posts: 114
Location: Tampere, Finland

PostPosted: Sun Jan 19, 2003 3:14 pm    Post subject: Reply with quote

I guess you have already figured out what those cron.daily, cron.weekly, ... are but everybody else might not know.

File /etc/crontab is the system level crontab file. Generally system level scripts are run from here but Gentoo has a bit different appoach. The crontab file appears to contain a line that runs a script /etc/sbin/run-crons every fifteen minutes. This script then checks the directories cron.hourly, cron.daily, cron.weekly and cron.monthly for scripts to be executed

With this system it's not necessary to learn how the actual cron program works. Adding a file containing desired script into correct directory is all that is needed.
Back to top
View user's profile Send private message
Seth
Apprentice
Apprentice


Joined: 25 May 2002
Posts: 156
Location: U.S.

PostPosted: Sun Jan 19, 2003 4:08 pm    Post subject: Reply with quote

tukem wrote:

File /etc/crontab is the system level crontab file. Generally system level scripts are run from here but Gentoo has a bit different appoach. The crontab file appears to contain a line that runs a script /etc/sbin/run-crons every fifteen minutes. This script then checks the directories cron.hourly, cron.daily, cron.weekly and cron.monthly for scripts to be executed


I've been wondering how that works. Thanks for explaining.

But what if you want to run a cron job at 3:00 am on the first day of the month? Is the cron.daily|weekly|monthly setup flexible enough to do that?

Thanks,

Seth
Back to top
View user's profile Send private message
tukem
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2002
Posts: 114
Location: Tampere, Finland

PostPosted: Sun Jan 19, 2003 4:26 pm    Post subject: Reply with quote

Well for that kind of use cron.daily, weekly, monthly is too unflexible. But in workstation use where the computer isn't necessarily on at 3:00 am on the first day of the month this system works. The script is simply run when the computer is turned on again.
Back to top
View user's profile Send private message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Sun Jan 19, 2003 11:55 pm    Post subject: Reply with quote

tukem wrote:
I guess you have already figured out what those cron.daily, cron.weekly, ... are but everybody else might not know.

File /etc/crontab is the system level crontab file. Generally system level scripts are run from here but Gentoo has a bit different appoach. The crontab file appears to contain a line that runs a script /etc/sbin/run-crons every fifteen minutes. This script then checks the directories cron.hourly, cron.daily, cron.weekly and cron.monthly for scripts to be executed

With this system it's not necessary to learn how the actual cron program works. Adding a file containing desired script into correct directory is all that is needed.


Actually I hadn't figured this out yet... Well, that part about it running scripts yet... But I can't seem to get it to work. I figured, hey, maybe it means the crontab files are scripts... didn't work. So then I thought maybe it meant bash scipts... Didn't work...
What EXACTLY are you supposed to put in that directory? ;)
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Mon Jan 20, 2003 12:50 am    Post subject: Reply with quote

Both /bin/sh and /bin/bash scripts will work. Did you remember to set it executable?

Code:

chmod 755 /etc/cron.daily/myscript.cron


They can be really simple, like my updatedb.cron...

Code:

#! /bin/bash
/usr/bin/updatedb


...or as complex as you like.
Back to top
View user's profile Send private message
gzaector
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2002
Posts: 132
Location: 304

PostPosted: Mon Jan 20, 2003 1:46 am    Post subject: Reply with quote

if someone didnt want to use the whole hour/day/week/month system, couldnt they just take the enteries out of /etc/crontab, then add whatever they wanted into /etc/crontab?
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Mon Jan 20, 2003 1:57 am    Post subject: Reply with quote

You can just add them to crontab without removing the others. Like this one for gentoo-stats:

Code:

0 0 * * 0,4     /usr/sbin/gentoo-stats --update >/dev/null
Back to top
View user's profile Send private message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Mon Jan 20, 2003 3:38 am    Post subject: Reply with quote

ronmon wrote:
Both /bin/sh and /bin/bash scripts will work. Did you remember to set it executable?


How do you do the *smack myself in the head for missing the obvious* emoticon?

Thanks... I'll have to wait for a little while to see if it works or not ;) but I'm guessing it probably will.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum