Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2008 18:03:51 +0200
From:      Albert Shih <Albert.Shih@obspm.fr>
To:        ElihuJ <chinocubus@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Cron Question
Message-ID:  <20080902160351.GI79391@pcjas.obspm.fr>
In-Reply-To: <19272656.post@talk.nabble.com>
References:  <19272656.post@talk.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 Le 02/09/2008 à 08:45:52-0700, ElihuJ a écrit
> 
> Hi all. I have a question about cron jobs that seem to be running to long or
> with multiple copies of itself. For example, I have a backup script that I
> run that seems to make multiple copies of itself. If I view the running
> processes I see numerous instances of the same cron job. Is there something
> I can do to limit this from happening? When it does, it drains my CPU and
> some of my other processes are non responsive. Any help would be
> appreciated. Thank you.

That's not the to cron to do that. You must put in your script some flags.

For example if you using 

	rsnapshot (in the ports)

he put a lock file in /var/run (or what's ever you want) and don't start if
the script find this file. When the script is end the file is erase.

Something like

if_the_lock_file_exit :

	exit 1

else

	touch lock_file

	my_script

	rm lock_file

fi.

Regards

-- 
Albert SHIH
SIO batiment 15
Observatoire de Paris Meudon
5 Place Jules Janssen
92195 Meudon Cedex
Heure local/Local time:
Mar 2 sep 2008 18:01:25 CEST



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