On Wednesday 29 May 2019 05:49:23 am Gene Heskett wrote:

> Several things;
>
> I wasn't aware cron was trying to run amanda every night during this
> non-functional time because I was not getting the emails from amanda
>
> I've a line at the top of amanda.conf instructing it to email
> [email protected] with the reports, but I find about 20 msgs for amanda
> in /var/mail/amanda, none of which contain the reason for the failure.
>
> So the first thing to do is find out why I didn't get those emails.
> This line, in my amanda.conf has been working since forever:
> mailto "[email protected]"
>
> But here is this mornings mail:
> ----------------------------------
> From [email protected] Wed May 29 02:01:11 2019
> Return-path: <[email protected]>
> Envelope-to: [email protected]
> Delivery-date: Wed, 29 May 2019 02:01:11 -0400
> Received: from amanda by coyote with local (Exim 4.89)
>         (envelope-from <[email protected]>)
>         id 1hVreB-0005U6-9A
>         for [email protected]; Wed, 29 May 2019 02:01:11 -0400
> From: [email protected] (Cron Daemon)
> To: [email protected]
> Subject: Cron <amanda@coyote> /GenesAmandaHelper-0.61/backup.sh Daily
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> X-Cron-Env: <SHELL=/bin/sh>
> X-Cron-Env: <HOME=/home/amanda>
> X-Cron-Env: <PATH=/usr/bin:/bin>
> X-Cron-Env: <LOGNAME=amanda>
> Message-Id: <E1hVreB-0005U6-9A@coyote>
> Date: Wed, 29 May 2019 02:01:11 -0400
>
> PATH=/usr/local/sbin:/GenesAmandaHelper-0.61/:/bin:/usr/bin
> /GenesAmandaHelper-0.61/backup.sh is being started with argument Daily
> tapelist
> MYDIR=/GenesAmandaHelper-0.61/
> AM_SBIN_DIR=/usr/local/sbin/
> DUMMY=0
> PERFORM=0
> BASE_CONFPATH=/usr/local/etc/amanda/
> /usr/local/var/amanda//Daily
> TAPELIST=/usr/local/etc/amanda//Daily/tapelist
> RUN_AMVERIFY=0
> VTAPES=1
> VTAPE_LOCATION=/amandatapes/Dailys
> LOGpath=/home/amanda/log/
> LOG=/home/amanda/log/log4gene
> ----------------------------------------------
> From root, to amanda?
>
> And thats it, the backup exited 11 seconds after it was started.
>
> I just added a MAILTO=gene in the amanda crontab, but I think the
> reason kmail isn't picking it up as amanda is perms related as I
> cleaned up the /e/group file a wee bit.
>
> I'll do some more screwing around after I wake up again, this is not a
> civilized time of the day unless going deer hunting.
>
> Cheers, Gene Heskett

I found it, I think.  In an effort to make my script immune to the 
instant pwd of the launching shell, I had written an if statement:

if [ $0 == "./backup.sh" ] || [ $0 == "${MYDIR}/backup.sh" ] || [ $0 
== "backup.sh" ] ; then

which for stretch, and I think even the early ubuntu's the slash was 
already on the end of $MYDIR so the second "or" failed because there 
were 2 // in the resultant string. But its worked that way for at least 
10 years. Makes one want to shoot the neighbors cat or something...  And 
of course the script is softlinked to flush.sh and detects the arg $0 to 
define how it works, I had to fix that line too. So its doing a late 
morning run, and the amanda crontab should now run it at 2:01 every 
morning.

Now, is that 3rd "or" anything but trash code? I think it could probably
could be removed as I can't think of a launch condition that would make 
it true. Thats probably a question for Jon, he's a real bash expert. I 
just play one on tv. :)

I think I am in business finally. ;-p


Copyright 2019 by Maurice E. Heskett
Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

Reply via email to