Amanda-Users

RE: Changed behavior of amflush, going to background?

2008-04-17 17:38:48
Subject: RE: Changed behavior of amflush, going to background?
From: "Zembower, Kevin" <kzembowe AT jhuccp DOT org>
To: <amanda-users AT amanda DOT org>
Date: Thu, 17 Apr 2008 15:55:31 -0400
Wow, I would have never guessed that I wanted -f (run in foreground) AND
-b (run in background) together. I assumed that they were mutually
exclusive. Will try out later. I suggest that the documentation be
changed to reflect this capacity. Thanks so much for suggesting this.

-Kevin

-----Original Message-----
From: Jean-Louis Martineau [mailto:martineau AT zmanda DOT com] 
Sent: Thursday, April 17, 2008 3:13 PM
To: Zembower, Kevin
Cc: amanda-users AT amanda DOT org
Subject: Re: Changed behavior of amflush, going to background?

man amflush:
       -f
           Run amflush in foreground.  Amflush normally detaches itself 
from the tty and runs as a background process.
           With the -f option, amflush stays in the foreground. This is 
useful if amflush is run as part of another script
           that, for example, advances the tape after the flush is 
completed.

You want: ( amflush -b -f DBackup && mt offline ) &

Zembower, Kevin wrote:
> I could have sworn that I used to be able to do an amflush and then
> eject the tape in the background with a command such as this, as the
> amanda user:
>
> echo 'amflush DBackup && mt offline' | at now
>
> However, this now sends me an email that seems to show it asking for
the
> right amanda backups to flush to tape. So, I also tried,
>
> echo 'amflush -b DBackup && mt offline' | at now
>
> But, this one seems to execute the 'mt offline' and eject the tape
just
> as soon as the amflush drops to the background. Using 'ps aux' shows
> tapers started immediately. I get the amflush email that there's no
tape
> present. I've pasted in my 'amadmin version' output at the end of this
> message.
>
> Any suggestions on a single command line that would do the amflush and
> then eject the tape in the background? For extra bonus points, how
could
> I combine this with a 'sudo -u backup ...' so that I can execute the
> whole thing without becoming the amanda user (assume that I have sudo
> set up correctly to execute any needed commands)?
>
> Thanks so much for your advice and suggestions.
>
>