Help Plz... Cron Job question....hellp...

2007-10-31 Thread VeeJay
Hello Gurus….



I am running a status script written in Perl (*status.pl*) and want to have
it *Always Running*.



How can I check through CRON that status.pl is running and if NO, then
start the script execution again?



Please help and advise…



With a bundle of thanks!


-- 
Thanks!

BR / vj
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Help Plz... Cron Job question....hellp...

2007-10-31 Thread Michaël Grünewald
VeeJay [EMAIL PROTECTED] writes:

 Hello Gurus….



 I am running a status script written in Perl (*status.pl*) and want to have
 it *Always Running*.

 How can I check through CRON that status.pl is running and if NO, then
 start the script execution again?

Why don't you use the following SH script?

  whule true; do
perl status.pl
  done

It will restart `status.pl' whenever it dies.
-- 
Best wishes,
Michaël
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Help Plz... Cron Job question....hellp...

2007-10-31 Thread Tino Engel
call a script called script.sh from cron e.g. every minute.
script.sh contains:

#!/bin/sh
ps -a | grep status.pl | |  perl status.pl

Am Mittwoch 31 Oktober 2007 08:32 schrieb VeeJay:
 Hello Gurus….



 I am running a status script written in Perl (*status.pl*) and want to have
 it *Always Running*.



 How can I check through CRON that status.pl is running and if NO, then
 start the script execution again?



 Please help and advise…



 With a bundle of thanks!


pgpFA51yluLwN.pgp
Description: PGP signature


Cron job question

2003-08-22 Thread Rick Hoekman
I am getting this message every 5 minutes. Can somebody explain to me
why root apparently is not found here?


X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Cron Daemon)
To: [EMAIL PROTECTED]
Subject: Cron [EMAIL PROTECTED] root /usr/libexec/atrun
X-Cron-Env: SHELL=/bin/sh
X-Cron-Env: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
X-Cron-Env: HOME=/root
X-Cron-Env: LOGNAME=root
X-Cron-Env: USER=root Date: Fri, 22 Aug
2003 19:05:00 +0200 (CEST) root: not found


Thanks!

Rick

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cron job question

2003-08-22 Thread Matthew Seaman
On Fri, Aug 22, 2003 at 07:18:16PM +0200, Rick Hoekman wrote:
 I am getting this message every 5 minutes. Can somebody explain to me
 why root apparently is not found here?
 
 
 X-Original-To: [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED] (Cron Daemon)
 To: [EMAIL PROTECTED]
 Subject: Cron [EMAIL PROTECTED] root /usr/libexec/atrun
 X-Cron-Env: SHELL=/bin/sh
 X-Cron-Env: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 X-Cron-Env: HOME=/root
 X-Cron-Env: LOGNAME=root
 X-Cron-Env: USER=root Date: Fri, 22 Aug
 2003 19:05:00 +0200 (CEST) root: not found
 

You've made the classic mistake of confusing the system crontab
(/etc/crontab) and the user specific crontabs that live in
/var/cron/tabs.  These are quite different files.

The system crontab /etc/crontab is not user specific: thus it has an
extra column defining which user ID the command should be run as.  In
general you shouldn't need to touch this file at all -- it's where
standard stuff like the 'at' queue, newsyslog and the
daily/weekly/monthly periodic functions are run from.  If you must
alter this file, just edit it directly: cron(8) will pick up the
changes in a minute or so.  In particular you do not need to use
crontab(1) to manage this file.

The per-user crontabs are what you would expect if you're familiar
with the SysV or Linux style cron(8) daemon.  Each user has their own
crontab file, which is managed using the crontab(1) command.  In
general it's a good policy to use the per-user crontab stuff to add
any new cron jobs for any user (including root) and leave the system
/etc/crontab in it's default state.

The error you're seeing suggests to me that what you've done is run
crontab(1) on /etc/crontab, and the extra column containing the userid
is being interpreted as a command that cron should run.  However,
there is no command 'root', hence the error message.  To fix, make
sute that /etc/crontab contains the default contents by copying over
/usr/src/etc/crontab or running mergemaster(1).  Backup and delete the
root crontab you've generated:

# crontab -l -u root  /tmp/root.crontab
# crontab -r -u root

Now, if root.crontab contains substantively the same as /etc/crontab,
you're done.  Otherwise, if you need to add some extra root cron jobs,
edit /tmp/root.crontab to strip out the default stuff, leaving only
you extra jobs.  Don't put a username in column 6 of the file: rather
that should be the last column and contain the command to run, as per
crontab(5).  Once edited to your liking load the new crontab file into
the system:

# vi /tmp/root.crontab
# crontab -u root /tmp/root.crontab

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgp0.pgp
Description: PGP signature


Re[2]: Cron job question

2003-08-22 Thread Rick Hoekman
Hello Matthew,

Thank you for taking the time explaining it to me!

Rick

Friday, August 22, 2003, 7:41:59 PM, you wrote:

MS On Fri, Aug 22, 2003 at 07:18:16PM +0200, Rick Hoekman wrote:
 I am getting this message every 5 minutes. Can somebody explain to me
 why root apparently is not found here?
 
 
 X-Original-To: [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED] (Cron Daemon)
 To: [EMAIL PROTECTED]
 Subject: Cron [EMAIL PROTECTED] root /usr/libexec/atrun
 X-Cron-Env: SHELL=/bin/sh
 X-Cron-Env: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 X-Cron-Env: HOME=/root
 X-Cron-Env: LOGNAME=root
 X-Cron-Env: USER=root Date: Fri, 22 Aug
 2003 19:05:00 +0200 (CEST) root: not found
 

MS You've made the classic mistake of confusing the system crontab
MS (/etc/crontab) and the user specific crontabs that live in
MS /var/cron/tabs.  These are quite different files.

MS The system crontab /etc/crontab is not user specific: thus it has an
MS extra column defining which user ID the command should be run as.  In
MS general you shouldn't need to touch this file at all -- it's where
MS standard stuff like the 'at' queue, newsyslog and the
MS daily/weekly/monthly periodic functions are run from.  If you must
MS alter this file, just edit it directly: cron(8) will pick up the
MS changes in a minute or so.  In particular you do not need to use
MS crontab(1) to manage this file.

MS The per-user crontabs are what you would expect if you're familiar
MS with the SysV or Linux style cron(8) daemon.  Each user has their own
MS crontab file, which is managed using the crontab(1) command.  In
MS general it's a good policy to use the per-user crontab stuff to add
MS any new cron jobs for any user (including root) and leave the system
MS /etc/crontab in it's default state.

MS The error you're seeing suggests to me that what you've done is run
MS crontab(1) on /etc/crontab, and the extra column containing the userid
MS is being interpreted as a command that cron should run.  However,
MS there is no command 'root', hence the error message.  To fix, make
MS sute that /etc/crontab contains the default contents by copying over
MS /usr/src/etc/crontab or running mergemaster(1).  Backup and delete the
MS root crontab you've generated:

MS # crontab -l -u root  /tmp/root.crontab
MS # crontab -r -u root

MS Now, if root.crontab contains substantively the same as /etc/crontab,
MS you're done.  Otherwise, if you need to add some extra root cron jobs,
MS edit /tmp/root.crontab to strip out the default stuff, leaving only
MS you extra jobs.  Don't put a username in column 6 of the file: rather
MS that should be the last column and contain the command to run, as per
MS crontab(5).  Once edited to your liking load the new crontab file into
MS the system:

MS # vi /tmp/root.crontab
MS # crontab -u root /tmp/root.crontab

MS Cheers,

MS Matthew

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cron job question

2003-08-22 Thread Vitali Malicky
cause perusal of the documentation, which is plenty for seeking mind, is not
you nature, sir...
crontab(1) i.e.

[EMAIL PROTECTED] man 1 crontab


 I am getting this message every 5 minutes. Can somebody explain to me
 why root apparently is not found here?


 X-Original-To: [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED] (Cron Daemon)
 To: [EMAIL PROTECTED]
 Subject: Cron [EMAIL PROTECTED] root /usr/libexec/atrun
 X-Cron-Env: SHELL=/bin/sh
 X-Cron-Env: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 X-Cron-Env: HOME=/root
 X-Cron-Env: LOGNAME=root
 X-Cron-Env: USER=root Date: Fri, 22 Aug
 2003 19:05:00 +0200 (CEST) root: not found


 Thanks!

 Rick

 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
[EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]