Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2006 12:07:29 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Marlon Martin <mmp013@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: cron question
Message-ID:  <20060405090729.GC29282@gothmog.pc>
In-Reply-To: <b2e814f30604041603i3149fdfene6d7c4c6ec58cf21@mail.gmail.com>
References:  <b2e814f30604041603i3149fdfene6d7c4c6ec58cf21@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-04-05 07:03, Marlon Martin <mmp013@gmail.com> wrote:
> i created a simple shell script:
>
> filename: rn
>
> #!/bin/sh
> rndc dumpdb
>
> what it does, is just dump the hostname and IP addresses in /var/dump
> i set the time in 2 minutes but when i checked the logs, it doesnt work any
> idea what did i missed here?
>
> ==============================================
>
> SHELL=/bin/sh
> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
> HOME=/var/log
> #
> #minute	hour	mday	month	wday	who	command
> #
> */5	*	*	*	*	root	/usr/libexec/atrun
> #
> # Save some entropy so that /dev/random can re-seed on boot.
> */11	*	*	*	*	operator /usr/libexec/save-entropy
> #
> # Rotate log files every hour, if necessary.
> 0	*	*	*	*	root	newsyslog
> #
> # Perform daily/weekly/monthly maintenance.
> 1	3	*	*	*	root	periodic daily
> 15	4	*	*	6	root	periodic weekly
> 30	5	1	*	*	root	periodic monthly
> /2     *       *       *       *         root   /home/ken/rn

You are missing a star '*' character before '/2' near the beginning of
the line immediatelly above.  Try this instead:

  */2   *       *       *       *         root   /home/ken/rn

Then make sure /home/ken/rn is executable.

I'd also suggest moving your `rn' script in `/root/scripts/rn' and
making `root:wheel' its owner.  The crontab entries from `/etc/crontab'
are executed with root permissions, so giving the user `ken' control
over what runs is creating a backdoor for anyone who gets access to that
non-root user account.

- Giorgos




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060405090729.GC29282>