Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2000 19:59:29 -0500 (CDT)
From:      Brennan W Stehling <brennan@offwhite.net>
To:        Doug Young <dougy@gargoyle.apana.org.au>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: "bad day_of_the_month" (yes really !!!) cron questions
Message-ID:  <Pine.BSF.4.10.10005041953560.55716-100000@home.offwhite.net>
In-Reply-To: <018e01bfb62c$58481b00$847e03cb@ROADRUNNER>

next in thread | previous in thread | raw e-mail | index | archive | help
When you set a cron job, you need to insert it into you cron file.  This
is explained in the con manpage so I will be brief.

I personally get confused when I set set cron jobs, so I always have cheat
notes in that file.  Here is a cronttab file which is set to run my
sendlogs.pl script every day at 2:30am.  The cron schedule is made up of 5
time pieces: minute, hour, day, month and day of the week.  With these
fields you can schedule it to run at any time you like.

You will notice that I have only set the minute and hour while the rest
are stars.  This mean I send on that minute and hour for every day of the
month, day of the year and day of the week.  I could easily tell it to do
this for me every Saturday by changing the last star to 6, which is
Saturday.

30 02 * * * /usr/local/bin/perl /home/brennan/bin/sendlogs.pl

#minute (0-59),
#hour (0-23),
#day of the month (1-31),
#month of the year (1-12),
#day of the week (0-6 with 0=Sunday)

It is a nice systems once you understand it.

Brennan Stehling - web developer and sys admin
projects: www.greasydaemon.com | www.onmilwaukee.com | www.sncalumni.com

fortune:
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.

On Fri, 5 May 2000, Doug Young wrote:

> I'd like to have remote systems email a copy of various logs at to me at
> sheduled times, & I understand that "cron" is supposed to be capable of
> doing this. What I don't understand is exactly how to go about it.
> 
> I followed the instructions in Complete FreeBSD, and even  though there's a
> file "/usr/bin/crontab", when I run "crontab -l" I get a message "no crontab
> for root"
> Now this sounds weird, because I understood from "man cron" & "man crontab"
> that a bunch of processes are controlled from the root cron, so what gives
> here ??
> 
> I then tried running "crontab crontab", but that just told me
> "crontab":0: bad day_of_month
> crontab: errors in crontab file, can't install
> 
> Thats the first I knew there was such a thing as gender in computers !!!!
> .... now I know there is a theory that the male of the species is affected
> by chronological factors as well as the more commonly known female variety,
> but I really don't think thats the cause of this particular problem. For
> what its worth I did have a bad BIOS battery a while back that caused system
> time to go back to 1994, but its OK right now. How do I convince crontab
> that the system is running the correct time now, or what else needs to be
> done to sort this out ??
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10005041953560.55716-100000>