[TriLUG] crontab question

Michael Hrivnak mhrivnak at triad.rr.com
Wed Sep 8 11:26:47 EDT 2004


Upon further investigation, I've come to the answer.  Based on the behavior 
exhibited in my logs, the notation:

-40 6,18 * * *	/path/to/some/script

Runs that script once every minute from 6:00 - 6:40, and then once every 
minute from 18:00 - 18:40.  So, I guess it assumes a leading 0 and works as a 
range indication.

YIKES!  This definitely explains the results I got.

Thanks,

Michael

On Wednesday 08 September 2004 10:06 am, William Sutton wrote:
> Hmm, well, a couple observations:
> 1. Your cron entry is deficient in terms of the number of parameters (see
> http://www.pantz.org/os/linux/programs/cron.shtml for a decent explanation
> of how they layout) so either you condensed it when you posted the entry
> or Kcron messed up (my guess is more likely Kcron)
> 2. I don't think the leading "-" is a valid entry.  I know it's used as a
> range delimiter, but when I ran a sample script via vcron, it got ignored:
>
> script:
> -----
> corran:~$ cat test.pl
> #!/usr/bin/perl
> use File::Slurp;
>
> my $date = `date`;
> my $file = "/home/william/test_file.txt";
>
> write_file($file, $date);
> -----
>
> crontab:
> -----
> corran:~$ crontab -l
> # DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.19703 installed on Wed Sep  8 08:52:35 2004)
> # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
> -1 * * * * /home/william/test.pl
> -----
>
> and the test file written:
> -----
> corran:~$ ll test_file.txt
> -rw-r--r--    1 william  users          29 Sep  8 09:01 test_file.txt
> -----
>
> Basically I think Kcron is broken :)
>
> William
>
> On Wed, 8 Sep 2004, Michael Hrivnak wrote:
> > What does it mean for the minute parameter in a crontab entry to begin
> > with a "-" ?
> >
> > for example, Kcron created this...
> >
> > -10 2,14	/path/to/some/script
> >
> > The script in question calls rsync.  I've been having a problem recently
> > that a large number of instances of rsync get started on this client,
> > along with an equivalent number of instances of rsync and sshd on the
> > server side, resulting in a DoS.  When I run the script on its own
> > though, it runs fine.
> >
> > Any clues?
> >
> > Michael



More information about the TriLUG mailing list