Amanda-Users

Re: Changed behavior of amflush, going to background?

2008-04-17 15:20:15
Subject: Re: Changed behavior of amflush, going to background?
From: Jean-Louis Martineau <martineau AT zmanda DOT com>
To: "Zembower, Kevin" <kzembowe AT jhuccp DOT org>
Date: Thu, 17 Apr 2008 15:13:09 -0400
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.