Subject RE: [firebird-support] Equivalent of GbakSchd for Linux (Scripts)
Author Tom Munro Glass
Thanks Salim. This does what I want as far as the daily backups are
concerned. However, I'd like to create a weekly backup on the first 3 or 4
Sundays of the month, but create a monthly backup on the last Sunday of the
month.

What I want to end up with is 6 daily backups created Mon to Sat (e.g.
Mon-MyDatabase.fbk.gz), 3 or 4 weekly backups created on Sundays (e.g.
Wk1-MyDatabase.fbk,gz) and 12 monthly backups created on the last Sunday of
each month (e.g. May-MyDatabase.fbk.gz).

So I can have two cron jobs, the daily one runs Mon-Sat and another that
runs on Sundays. The problem for the Sunday job is how to determine whether
it's the last Sunday of the month or which week of the month it is. I have
written Delphi code to do this, but I'm not sure how to do this in a bash
script.

Tom

> -----Original Message-----
> From: Salim Naufal [mailto:salim.naufal@...]
> Sent: Saturday, 8 May 2004 21:51
> To: firebird-support@yahoogroups.com
> Subject: RE: [firebird-support] Equivalent of GbakSchd for Linux
> (Scripts)
>
>
> Hi Tom,
>
> This is the crontab for the backups: it will execute /backups/dbackup.sh
> from Monday to Thursday and /backups/wbackup.sh on Fridays
>
> dbServer1:/backups # crontab -l
> # DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.5730 installed on Mon May 3 17:45:52 2004)
> # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
> 50 16 * * 1-4 /backups/dbackup.sh
> 50 16 * * 5 /backups/wbackup.sh
>
>
> Listing of the sbackup.sh:
> ------------------------------------------------------------------------
> /opt/firebird/bin/gbak -b -T -user sysdba -password masterkey
> /database/stock.fdb /backups/stock.fbk
> gzip -9 /backups/stock.fbk
>
> currDateCommand="date +%B%d%Y"
> currDate=`$currDateCommand`
> echo $currDate
>
> mount /StocksBackups
>
> mv /backups/stock.fbk.gz /StocksBackups/$currDate-Stock.fbk.gz
> ------------------------------------------------------------------------
>
> listing of the wbackup.sh:
> ------------------------------------------------------------------------
>
> /opt/firebird/bin/gbak -b -T -user sysdba -password masterkey
> /database/stock.fdb /backups/stock.fbk
> gzip -9 /backups/stock.fbk
>
> currDateCommand="date +%B%d%Y"
> currDate=`$currDateCommand`
> echo $currDate
>
> mount /StocksBackups
>
> mv /backups/stock.fbk.gz /StocksBackups/$currDate-WeeklyStock.fbk.gz
> ------------------------------------------------------------------------
>
> To mount the /StocksBackups directory which is on a MS Windows
> system, edit
> the fstab and register the line below:
>
> //192.168.0.123/Backupdir /StocksBackups smbfs
> username=administrator,password=adminpwd 0 0
>
> The 192.168.0.123 is the IP of the Windows PC, the Backupdir is the share
> name on windows, /StocksBackups is the directory where the share
> is mounted
> on linux, and the rest is user name and password to access the share.
>
> I hope that this is what you are looking for
>
> Salim
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>