Amanda-Users

Re: Has anyone a script for Monthly/Daily backups

2005-08-17 14:05:14
Subject: Re: Has anyone a script for Monthly/Daily backups
From: Frank Smith <fsmith AT hoovers DOT com>
To: "chuck.amadi" <chuck.amadi AT ntlworld DOT com>, amanda <amanda-users AT amanda DOT org>
Date: Wed, 17 Aug 2005 12:53:40 -0500
--On Wednesday, August 17, 2005 17:58:30 +0100 "chuck.amadi" <chuck.amadi AT 
ntlworld DOT com> wrote:

> Has anyone a script that will check for the last friday of the month and if 
> So run the monthly config backup or if not the usually daily config.
 
If you have gnu date available (the one used by Linux and sometimes
available on other OSes, or you could build it from source) , you could
run a script from cron every Friday that does something like:

if [ `date -d 'next friday' +%m` -ne `date +%m` ] ; then
  amdump archiveconfig
fi

If you don't have gnu date then it gets messy, since you have to figure
out if 7 days from now is still this month or next, worrying about the
length of the month and whether or not it's a leap year.

> I am currently looking at hacking something together as I was just going to 
> edit the crontab and comment and uncomment between daily and monthly.
> 
> I have a 10 tape run So a 2 week daily schedule but I to implement a monthly 
> that will run on the last fridat of each month.

Make sure your archive config dumptype has 'record no' in it or it will
mess up your daily schedule.

Frank

> 
> If anyone got a script please let me know ever - way I will post my hack if 
> possible.



-- 
Frank Smith                                      fsmith AT hoovers DOT com
Sr. Systems Administrator                       Voice: 512-374-4673
Hoover's Online                                   Fax: 512-374-4501