From owner-freebsd-questions Thu May 4 19:31:27 2000 Delivered-To: freebsd-questions@freebsd.org Received: from home.offwhite.net (home.offwhite.net [156.46.35.30]) by hub.freebsd.org (Postfix) with ESMTP id 043FF37B793 for ; Thu, 4 May 2000 19:31:24 -0700 (PDT) (envelope-from brennan@offwhite.net) Received: from localhost (brennan@localhost) by home.offwhite.net (8.9.1/8.9.3) with ESMTP id VAA56238; Thu, 4 May 2000 21:31:10 -0500 (CDT) Date: Thu, 4 May 2000 21:31:10 -0500 (CDT) From: Brennan W Stehling To: Doug Young Cc: freebsd-questions@FreeBSD.ORG Subject: Re: "bad day_of_the_month" (yes really !!!) cron questions In-Reply-To: <01be01bfb638$6d9c0af0$847e03cb@ROADRUNNER> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You can run any binary or script from a crontab. I usually use shell scripts, but if I am mucking with a database I use perl. If you want to mail the contents of a file you can use the mail binary. Here is a line you can add directly to your crontab to get nightly mailings. 30 01 * * * cat /var/log/message | mail -s "nightly" you@there.com Change the subject and destination as necessary. The drawback is that the contents of the file are in the body of the mail, not as an attachement. If you want to do that, you could use a perl script. 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: > Thanks Brennan > > > 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. > > > My "man cron" is only about 20 lines long, and there's not so much as a > mention of > how one "sets" a cron job. "Man crontab" is only slightly less cryptic, and > again fails to tell one anything of value about the system crontab, or how > to specify a particular job to be run. All I can find on the subject in the > mailing list archives suggests that its not a good thing to use "crontab" > with any switch to edit the system crontab. > > > I personally get confused when I set set cron jobs, so I always have cheat > > notes in that file. > > I get confused trying to comprehend man pages !!! Seems the writers of > those things assume the reader is either a mind-reader or an expert who > doesn't need to be told most of the critical points that are left out. > > Your sample crontab suggests the use of perl ..... I wouldn't know a perl > script if one attacked me in the night, so is that something critical to > using crontabs as such or just something you've developed for a particular > job ?? > > Somehow I've gotta figure out how to tell "mail" to send stuff like ppp.log > to a given email address. Since it appears that this is not covered at all > in the various man pages / handbook / Complete FreeBSD, where does one go > for a straightforward explanation of all the steps / terminology / syntax / > whatever else is required to get it to work ?? > > > > > 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