Re: Cron and Amdump

2002-02-07 Thread John R. Jackson

>Funny, just before I got your email, I set up the cron the following
>way:
>45 0 * * 2-6/usr/sbin/amdump BIG1 >& /tmp/debug
>
>This morning, I have the following in /tmp/debug
>amdump: could not find directory /etc/amanda/BIG
>
>I am not sure why BIG1 is being truncated to BIG, and why did it just
>start to happen.

Two things.  The output redirect you added, ">&", is a csh-ism.  Is your
cron running the amanda entries with that shell, or is it running them
with /bin/sh?

One way to tell would be to add a temporary entry like this:

  ... ps -p $$ > /tmp/cron.shell.test

Second, it looks like the '1' on the end of "BIG1" got mis-interpreted
by the shell (or you have a typo).  The '1' got put together with the
output redirection as though you had done this:

  /usr/sbin/amdump BIG 1>& /tmp/debug

which means "redirect file descriptor 1 (stdout) to this file".  That also
implies cron is using some sh variant (sh, ksh, bash) rather than csh, so
you should really be using this syntax (which is the equivalent of ">&"):

  /usr/sbin/amdump BIG1 > /tmp/debug 2>&1

>Karl Bellve

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]



Re: Cron and Amdump

2002-02-07 Thread Karl Bellve


John,

Thanks for the great advice.

Funny, just before I got your email, I set up the cron the following
way:
45 0 * * 2-6/usr/sbin/amdump BIG1 >& /tmp/debug

This morning, I have the following in /tmp/debug
amdump: could not find directory /etc/amanda/BIG


I am not sure why BIG1 is being truncated to BIG, and why did it just
start to happen.

Amanda home directory/login is valid (su - amanda -c pwd). I tested that
last week.

I am running last nights dump right now, but I will test the cron again
by changing its time to a few minutes in the future for testing. Thanks.


"John R. Jackson" wrote:
> 
> >For some strange reason, cron has stopped running Amdump for me at
> >night.  ...
> >Here is Amanda's crontab:
> >0 16 * * 1-5/usr/sbin/amcheck -m BIG1
> >45 0 * * 2-6/usr/sbin/amdump BIG1
> 
> Here are some debugging things I would try:
> 
>   * Change the amdump line to something like this:


-- 
Cheers,



Karl Bellve, Ph.D.   ICQ # 13956200
Biomedical Imaging Group TLCA# 7938 
University of Massachusetts
Email: [EMAIL PROTECTED]
Phone: (508) 856-6514
Fax:   (508) 856-1840
PGP Public key: finger [EMAIL PROTECTED]



Re: Cron and Amdump

2002-02-06 Thread John R. Jackson

>For some strange reason, cron has stopped running Amdump for me at
>night.  ...
>Here is Amanda's crontab:
>0 16 * * 1-5/usr/sbin/amcheck -m BIG1
>45 0 * * 2-6/usr/sbin/amdump BIG1

Here are some debugging things I would try:

  * Change the amdump line to something like this:
  
45 0 * * 2-6echo Starting amdump ; /usr/sbin/amdump BIG1 ; echo amdump status: 
$?

This will generate some output to stdout which, in theory, cron should
E-mail to the crontab owner ("amanda" in your case).  If you don't
get that E-mail, then you may not have mail set up properly for that
user on that machine (e.g. you need an aliases entry or something
like that).  You may even find the E-mail has been accumulating
someplace you didn't expect :-).

  * Another alternative:

45 0 * * 2-6/bin/sh -x /usr/sbin/amdump BIG1 > /tmp/amdump.$$ 2>&1

This will run amdump via sh with the "trace" (-x) flag set.  Two
things will happen.  First, you should get the /tmp/amanda.$$ file
created.  If you don't then I don't think cron actually tried to run
the process (or it died before ever getting started for some reason).

If you do get the /tmp/amdump.$$ file, take a look at it and see if
it has anything interesting to say about why amdump bailed out.

  * Another possibility would be to temporarily change your crontab
entry to start a couple of minutes from now and then run strace
on cron itself to watch it start amdump.  You probably want -f to
follow forks and "-o output-file" to save the output someplace as
it may be large.

>I changed group permissions for Amanda about a week ago.  ...

It's possible cron has cached some information about the Amanda user.
You might try re-submitting the crontab to (hopefully) make it refresh
things.  If that doesn't help, you might stop and restart cron.

You might also check the "amanda" home directory and shell to see if
they are valid.  This would be a quick test (as root):

  su - amanda -c pwd

The first '-' tells "su" to set up the environment as though the user
had logged in, which is closer to what cron does than "su amanda -c ...".

>Karl Bellve

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]



Re: Cron and Amdump

2002-02-05 Thread Karl Bellve



Rick Morris wrote:
> 
> Are you sure that the cron daemon is still running?
> ps aux | grep crond
> 
> We have a box that the http daemon occasionally fills up memory, and the vm
> system seems to dump crond before anything else.
> 

Yes...

root  1105  0.0  0.1  3696  128 ?SJan29   0:00 crond

It also logs the attempt to run /usr/sbin/amdump in cron.log:
Feb  5 00:45:00 itchy CROND[6620]: (amanda) CMD (/usr/sbin/amdump BIG1)


-- 
Cheers,



Karl Bellve, Ph.D.   ICQ # 13956200
Biomedical Imaging Group TLCA# 7938 
University of Massachusetts
Email: [EMAIL PROTECTED]
Phone: (508) 856-6514
Fax:   (508) 856-1840
PGP Public key: finger [EMAIL PROTECTED]



Re: Cron and Amdump

2002-02-05 Thread Karl Bellve



Rebecca Pakish wrote:
> 
> What does it say it /etc/group? Is amanda listed in the users for disk
> there? Did you reconfig amanda with-group=disk after you made this change?
> 

Amanda is part of group disk.

disk:x:6:root,amanda

I didn't compile Amanda, but used the RPMS. Redhat changed the user that
Amanda was run under with the last RPM upgrade from operator to amanda.
I didn't pay attention to see if they also changed the group that Amanda
belonged to.

So, last week, I noticed that I still had the following in /etc/group

disk:x:6:root,operator

But, I can't see why this would have broke cron running amdump.

Remember, I can still run amdump as user amanda without problems.

-- 
Cheers,



Karl Bellve, Ph.D.   ICQ # 13956200
Biomedical Imaging Group TLCA# 7938 
University of Massachusetts
Email: [EMAIL PROTECTED]
Phone: (508) 856-6514
Fax:   (508) 856-1840
PGP Public key: finger [EMAIL PROTECTED]



RE: Cron and Amdump

2002-02-05 Thread Rebecca Pakish

What does it say it /etc/group? Is amanda listed in the users for disk
there? Did you reconfig amanda with-group=disk after you made this change? 

-Original Message-
From: Karl Bellve [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 9:38 AM
To: Amanda
Subject: Cron and Amdump




For some strange reason, cron has stopped running Amdump for me at
night. I do see that cron is trying to run amdump at night.

cron.log:
Feb  5 00:45:00 itchy CROND[6620]: (amanda) CMD (/usr/sbin/amdump BIG1) 


Here is Amanda's crontab:
0 16 * * 1-5/usr/sbin/amcheck -m BIG1
45 0 * * 2-6/usr/sbin/amdump BIG1


There is nothing in /tmp/amanda, as if amdump never runs.

If I manually run amdump:
su amanda -c "/usr/sbin/amdump BIG1"

It works. I get logs in /tmp/amanda, and a report emailed to me.

I changed group permissions for Amanda about a week ago. I noticed that
I still had Amanda in the group "operator" from a previous install from
a redhat rpm. Now, amanda is part of group "disk" (6).

Amanda is set up like the following:
amanda:x:33:6:Amanda user:/var/lib/amanda:/bin/bash



Any thoughts?






-- 
Cheers,



Karl Bellve, Ph.D.   ICQ # 13956200
Biomedical Imaging Group TLCA# 7938 
University of Massachusetts
Email: [EMAIL PROTECTED]
Phone: (508) 856-6514
Fax:   (508) 856-1840
PGP Public key: finger [EMAIL PROTECTED]



Re: Cron and Amdump

2002-02-05 Thread Rick Morris

Are you sure that the cron daemon is still running?
ps aux | grep crond

We have a box that the http daemon occasionally fills up memory, and the vm 
system seems to dump crond before anything else.

On Tuesday 05 February 2002 07:38, Karl Bellve wrote:
> For some strange reason, cron has stopped running Amdump for me at
> night. I do see that cron is trying to run amdump at night.
>
> cron.log:
> Feb  5 00:45:00 itchy CROND[6620]: (amanda) CMD (/usr/sbin/amdump BIG1)
>
>
> Here is Amanda's crontab:
> 0 16 * * 1-5/usr/sbin/amcheck -m BIG1
> 45 0 * * 2-6/usr/sbin/amdump BIG1
>
>
> There is nothing in /tmp/amanda, as if amdump never runs.
>
> If I manually run amdump:
> su amanda -c "/usr/sbin/amdump BIG1"
>
> It works. I get logs in /tmp/amanda, and a report emailed to me.
>
> I changed group permissions for Amanda about a week ago. I noticed that
> I still had Amanda in the group "operator" from a previous install from
> a redhat rpm. Now, amanda is part of group "disk" (6).
>
> Amanda is set up like the following:
> amanda:x:33:6:Amanda user:/var/lib/amanda:/bin/bash
>
>
>
> Any thoughts?

-- 
Rick Morris
Network Manager
WeDoHosting.com
101-4226 Commerce Circle
Victoria  BC  V8Z 6N6

ph: +1 250 479 1595
fax: +1 250 479 1517

[EMAIL PROTECTED]
http://www.wedohosting.com