Unix questions - crontab Qs

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > November 2006 > crontab Qs





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author crontab Qs
pemo

2006-11-13, 9:01 am

How can I setup two crontab jobs - one to run daily and one to run weekly?

I've had a daily one for sometime - it 'monitors' web pages I'm interested
in, and emails me a diff when pages change. However, as some of these pages
change a bit too frequently, I'd like to move some of them into a 'check
monthly' list.

When I set up the current job, I created a mycrontab file ...

00 10 * * * $HOME/runReports.pl
00 17 * * * $HOME/runReports.pl

I also ran some kind of 'hey cron - watch this lot' command that I now
cannot remember, but I seem to recall that it 'registered' this file with
cron???

So anyhow, I'd now like to add a monthly job ...

00 10 * * * $HOME/runReports.pl
00 17 * * * $HOME/runReports.pl
00 00 01 * * $HOME/runReportsWk.pl

runReportsWk.pl should run on 1st of every month.


--
========================================
======================================
USENET: Post to exotic, distant machines. Meet exciting, unusual people.
And flame them.

Dan Sorenson
========================================
======================================


Jens Thoms Toerring

2006-11-13, 9:01 am

pemo <usenetmeister@gmail.com> wrote:
> How can I setup two crontab jobs - one to run daily and one to run weekly?


Since you already know how to do it daily, here's just the pattern
for a weekly job:

35 11 * * 5 /do/this/job

The first two fields are the minutes and hours, the fifth is the day
of the week (0 (or 7) is Sunday, 1 is Monday etc.) So this job would
get started on every Friday at 11:35 pm.

> I've had a daily one for sometime - it 'monitors' web pages I'm interested
> in, and emails me a diff when pages change. However, as some of these pages
> change a bit too frequently, I'd like to move some of them into a 'check
> monthly' list.


> When I set up the current job, I created a mycrontab file ...


> 00 10 * * * $HOME/runReports.pl
> 00 17 * * * $HOME/runReports.pl


> I also ran some kind of 'hey cron - watch this lot' command that I now
> cannot remember, but I seem to recall that it 'registered' this file with
> cron???


> So anyhow, I'd now like to add a monthly job ...


> 00 10 * * * $HOME/runReports.pl
> 00 17 * * * $HOME/runReports.pl
> 00 00 01 * * $HOME/runReportsWk.pl


> runReportsWk.pl should run on 1st of every month.


Use the command "crontab -l' to list what jobs cron is already
doing for you and "crontab -e" to edit that list (set the
EDITOR environment variable to your editor of choice) - that's
all it needs. And what you plan to put into it looks ok.

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Bill Marcum

2006-11-13, 9:01 am

On Fri, 10 Nov 2006 07:55:33 -0000, pemo
<usenetmeister@gmail.com> wrote:
>
> When I set up the current job, I created a mycrontab file ...
>
> 00 10 * * * $HOME/runReports.pl
> 00 17 * * * $HOME/runReports.pl
>
> I also ran some kind of 'hey cron - watch this lot' command that I now
> cannot remember, but I seem to recall that it 'registered' this file with
> cron???
>

crontab

> So anyhow, I'd now like to add a monthly job ...
>
> 00 10 * * * $HOME/runReports.pl
> 00 17 * * * $HOME/runReports.pl
> 00 00 01 * * $HOME/runReportsWk.pl
>
> runReportsWk.pl should run on 1st of every month.
>

crontab -e

--
Never invest your money in anything that eats or needs repainting.
-- Billy Rose
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com