Subject | RE: [firebird-support] Re: Looking for Linux backup script |
---|---|
Author | Graeme Bruton |
Post date | 2005-11-28T22:53:14Z |
Hi Lou
I put mine in a file under "/usr/local/bin/" called "dailybackup" which
crontab runs from Monday to Friday to 23:00 and contains the following:-
#!/bin/bash
BACKUP=/disk1/backups/Daily.`date +'%a'`.bz2
tar -jcf $BACKUP /what_I_want_to_backup /maybe/users/mail/files /etc ....
This creates a zipped file called "Daily.Mon.bz2.
What you need to do is "man date" to get the context of what you want your
files to be called. In this instance, "%a" is an abbreviated week day name.
What you would then add is your gbak command, let that get backed up
somewhere, and then let the above zip it using tar and name it according to
your specs.
Hope this helps.
Graeme
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]On Behalf Of Adam
Sent: Tuesday, November 29, 2005 12:23 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Looking for Linux backup script
I put mine in a file under "/usr/local/bin/" called "dailybackup" which
crontab runs from Monday to Friday to 23:00 and contains the following:-
#!/bin/bash
BACKUP=/disk1/backups/Daily.`date +'%a'`.bz2
tar -jcf $BACKUP /what_I_want_to_backup /maybe/users/mail/files /etc ....
This creates a zipped file called "Daily.Mon.bz2.
What you need to do is "man date" to get the context of what you want your
files to be called. In this instance, "%a" is an abbreviated week day name.
What you would then add is your gbak command, let that get backed up
somewhere, and then let the above zip it using tar and name it according to
your specs.
Hope this helps.
Graeme
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]On Behalf Of Adam
Sent: Tuesday, November 29, 2005 12:23 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Looking for Linux backup script
--- In firebird-support@yahoogroups.com, "Lou" <lfeliz@y...> wrote:
>
> HEllo.
>
> For years I have used a program called GBACKSCHED on my Win32 servers
> to backup firebird db's using a method that provided daily and weekly
> archiving. I am now moving servers to Linux and need a utility that
> will do the same and was thinking a shell script run by crontab would
> do the trick.
>
> Is there utiliyt I can configure and load to do this or must I use
> gbak via crontab etc...
>
> I know how to use cronta to schedule a backup task using gbak, but
> what I am looking for is source to a script that I can run using
> crontab that will do the following:
>
> 1) Run gbak
> 2) gzip the backup file
> 3) rename it
> 4) store zip files by day and the weekly versions upto 4 weeks.
>
> My goal is to have the following:
>
> A daily backup named according to day of week and backup set i.e.
>
> FBDBxyzMON.zip,FBDBxyzTue.zip,FBDBxyzWED.zip etc...
>
> for each day of week.
> For a specific day, I would then have a weekly archive i.e.
> FBDBxyzFRI_1.zip for lets say 4 weeks after which, the following would
> happen
>
> The existing 4 would be moved to a folder overwriting the prior 4
> weeks saved and then the process could continue.
>
> The end result being I hav a dialy backup and a weekly backup for a a
> maxium of 7+ weeks, not to mention what I save to tape etc...
>
> Does this exist at all?
>
> Thanks.
>
> - Lou
>
Don't forget to restore the backup file to a temporary location to
make sure it is valid as part of your script. When your hard disk
bombs, it is not really the best time to start wondering if your
backups were successful.
Adam
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.9/185 - Release Date: 11/28/2005