Amanda is programmed to hold if a particular file exists.   My systems are all 
down for electrical and cooling work today, so the specifics of this may be 
wrong (write back if you want the correct ones, tomorrow)  but you could always 
run your amanda dumps like this:

file  run_my_amdumps
     at +3 minutes    touch <config-area>/hold        #not certain of the file 
name, right now - or the format: do I need quotes?
     amdump  <config>   <DLEs>
     rm   <config-area>/hold


You can’t just  touch the file and then start amdump - because THAT amdump will 
hold too.
So you’ve got a 3 minute race condition there.

And this won’t help with shutdowns, unless you look for the file yourself, 
before shutting down.

Deb Baddorf
Fermilab


> On Sep 23, 2020, at 1:04 PM, Chris Hoogendyk <[email protected]> wrote:
> 
> I used to use a script like this before I got a second tape drive in the 
> library for this server. This script ran in a cron. So if there was any 
> output, I would get an email. The days-running calculation alerted me if 
> there was a hangup and it had been running for way too long. It would often 
> go over into the next day, but if it went further than that (days running 2 
> or greater) I would have to look at it and probably intervene.
> 
> 
>   !/bin/bash
>   #
>   # This server can't handle multiple runs of Amanda in parallel.
>   # Therefore, check to see that Amanda is not running before launching a run 
> of Amanda.
>   #                              Chris H., 2019/08/22
>   #
>     if ps -ef | grep amanda | grep taper > /dev/null; then
>         DAYSRUNNING=`cat /usr/local/adm/backup/days-running`;
>         ((DAYSRUNNING=DAYSRUNNING+1));
>         echo "$DAYSRUNNING" > /usr/local/adm/backup/days-running;
>         echo "";
>         echo "           ===============================";
>         echo "    ***    AMANDA ALREADY RUNNING – $DAYSRUNNING DAYS    ***";
>         echo "           ===============================";
>         echo "";
>         exit 1;
>     else
>        su - amandabackup -c "/usr/local/sbin/amdump daily" > /dev/null;
>        /usr/local/bin/amchanger daily unload > /dev/null;
>        echo "0" > /usr/local/adm/backup/days-running;
>        exit 0;
>     fi
> 
> 
> 
> On 9/23/20 1:18 PM, Nathan Stratton Treadway wrote:
>> On Wed, Sep 23, 2020 at 10:10:21 +0700, Olivier wrote:
>>> Does it exist a command that can be used to check whether amanda is busy
>>> or not?
>>> 
>>> For example, do not launch the daily backup if the previous one is still
>>> running, or do not reboot Amanda server (network stability issue) if a
>>> backup is being done.
>> I don't know of a straightforward Amanda-provided command to do exactly
>> this.
>> 
>> (Note that in older versions, Amanda would abort a new amdump run if an
>> old run was still underway, but in v3.5 there is support for concurrent
>> runs so it specifically doesn't abort automatically any more.)
>> 
>> In general, you can look to see if /var/log/amanda/<CONFIG>/amdump
>> exists.  That symlink is created when amdump starts, and renamed to
>> "amdump.1" as amdump finishes, so if the "amdump" symlink still exists
>> than the job is still running (... or it died without cleaning up).
>> 
>> If you are programming a script to check for this, you might also check
>> for an "amflush" symlink at the same time -- that symlink exists while
>> amflush is running, and depending on your configuration you might not
>> want to start a new amdump job while amflush is running, either.
>> 
>> 
>> For a manual check, you can run the "amstatus' command to see the status
>> of either the current in-progress run (if it shows the amdump or amflush
>> file) or last-complieted run (amdump.1/amflush.1).
>> 
>> 
>>                                      Nathan
>> 
>> ----------------------------------------------------------------------------
>> Nathan Stratton Treadway  -  [email protected]  -  Mid-Atlantic region
>> Ray Ontko & Co.  -  Software consulting services  -   
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ontko.com_&d=DwIDaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=HMrKaRiCv4jddln9fLPIOw&m=CcPerZ17tXw9et5kS3gD3JJ6rrB58vLV-eY3sRwy0ug&s=69P1u8rmTWArMRYgWWLS53baF5v-v05TyBK0RPU8eSs&e=
>>    GPG Key: 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ontko.com_-7Enathanst_gpg-5Fkey.txt&d=DwIDaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=HMrKaRiCv4jddln9fLPIOw&m=CcPerZ17tXw9et5kS3gD3JJ6rrB58vLV-eY3sRwy0ug&s=DnIdZIP-xuPmu5II8gbhAMa5d3rZj4Yf5nbH2IoYfXI&e=
>>     ID: 1023D/ECFB6239
>>  Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239
> 
> -- 
> ---------------
> 
> Chris Hoogendyk
> 
> -
>   O__  ---- Systems Administrator, Retired
>  c/ /'_ --- Biology & Geosciences Departments
> (*) \(*) -- 315 Morrill Science Center III
> ~~~~~~~~~~ - University of Massachusetts, Amherst
> 
> <[email protected]>
> 
> ---------------
> 
> Erdös 4
> 


Reply via email to