Networker

Re: [Networker] Different Retention per backup levels

2003-04-07 09:22:40
Subject: Re: [Networker] Different Retention per backup levels
From: "Stuckless, Colin 709 778-3815" <cstuckless AT PETRO-CANADA DOT CA>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Mon, 7 Apr 2003 07:22:24 -0600
> -----Original Message-----
> From: Davina Treiber [mailto:treiber AT HOTPOP DOT COM]
> Sent: Thursday, February 06, 2003 10:48 AM
> To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
> Subject: Re: [Networker] Different Retention per backup levels
> 
> If you are still determined to do your group scheduling from within
> NetWorker it is still possible by putting a wrapper script around the
> savegrp command. To do this, you need to rename the savegrp command to
> something else (savegrp.bin?) and replace it with a shell script called
> savegrp. This shell script would work out the desired browse and retention
> (perhaps from a lookup table based on the current day?) and translate this
> into suitable values for the -w and -y parameters which it would add at
this
> point before calling the renamed savegrp.bin. You have to remember to
remake
> this change next time you upgrade NetWorker. This definitely works, I have
> done it before. Mick W, if you're reading this it might sound a bit
> familiar?  ;-)


Davina (and all),

I like this approach. I've got a schedule of incrementals every night, and
a Full every Friday. I want to retain one Full per month indefinitely 
(let's say 10 years), and keep the indexes online for 1 year. Everything
else gets recycled after 60 days. To make it simple, I've chosen to retain
the first Full for the month (Day of week equal to Friday, and day of month
less than or equal to 7). My group name is TNA, and that gets passed in the
$1 variable. My server is a Solaris 8 box running Networker 6.1.3.

Here's my simple sh script. The savegrp binary has been renamed to
savegrp.orig:
---
#!/bin/sh

WEEKDAY=`date +%a`
DAYOFMONTH=`date +%e`
SAVEGRP=/usr/sbin/savegrp.orig

if [ $WEEKDAY -eq Fri ]
then
        if [ $DAYOFMONTH -le 7 ]
        then
                SAVEGRP='/usr/sbin/savegrp.orig -y "10 years" -w "1 year"'
        fi
fi

$SAVEGRP $1
---


My problem is related to a shell 'nuance', as far as I can tell. When 
my savegrp tries to run on the first Friday of the month I get:

savegrp.orig: invalid retention time: "10

Something happens to the arguments when savegrp is kicked off from
within the script. The "10 years" gets broken up at the whitespace
between "10" and "years" and savegrp.orig complains about it. I tried
escaping the quotes and the space with a backslash but that didn't work.

I can add an 'echo' to the end of the script to see what my '$SAVEGRP $1'
command arguments look like, and from the echo output everything is fine,
I see:

/usr/sbin/savegrp.orig -y "10 years" -w "1 year" TNA 

I can run this from an interactive shell, and everything works fine. From 
nwadmin I see the savegrp starting successfully.

Can anyone help? I haven't had any luck searching for this issue on the net,
and I rewrote the script in csh syntax and csh gave me the same complaint.
I'm continuing to look for the proper 'escaping' option as I believe this
could work around it.


Colin Stuckless 



                         ********************

This email communication is intended as a private communication for the sole
use of the primary addressee and those individuals listed for copies in the
original message. The information contained in this email is private and
confidential and if you are not an intended recipient you are hereby
notified that copying, forwarding or other dissemination or distribution of
this communication by any means is prohibited.  If you are not specifically
authorized to receive this email and if you believe that you received it in
error please notify the original sender immediately.  We honour similar
requests relating to the privacy of email communications.

Cette communication par courrier électronique est une communication privée à
l'usage exclusif du destinataire principal ainsi que des personnes dont les
noms figurent en copie.  Les renseignements contenus dans ce courriel sont
confidentiels et si vous n'êtes pas le destinataire prévu, vous êtes avisé,
par les présentes que toute reproduction, tout transfert ou toute autre
forme de diffusion de cette communication par quelque moyen que ce soit est
interdit.  Si vous n'êtes pas spécifiquement autorisé à recevoir ce courriel
ou si vous croyez l'avoir reçu par erreur, veuillez en aviser l'expéditeur
original immédiatement.  Nous respectons les demandes similaires qui
touchent la confidentialité des communications par courrier électronique.

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

<Prev in Thread] Current Thread [Next in Thread>