Subject: Re: Followup on File backup question of Feb 4
From: David J. Weller-Fahy (dave-lists-aklug@weller-fahy.com)
Date: Thu Feb 12 2004 - 22:39:32 AKST
* Bob Crosby <bob@estimations.com> [2004-02-12 15:42 -0900]:
> Following up on my earlier question(s) about file backups, I ended up
> using the following script that Dave posted. (Works great. Thanks!) I
> now have a script that writes job files to a set of zipfiles on a
> backup drive, each one sized to fit on a single CD. And, using the -u
> option, it is pretty quick because it only has to update files that
> changed that day since the last backup.
Glad that I could help!
> zip -r -i@/mnt/backupdrive/jobs/BAKLST-temp.ABCD -u /mnt/backupdrive/jobs/jobs_A-C /home/jobs/Active/
>
> Here's another question: Could I use the variable names declared at
> the top instead of spelling out the long pathnames in this command? I
> thrashed around with it for a while, but couldn't figure out the
> syntax to get it to work.
So, assuming:
> > >BAKLSTDIR=/home/jobs/active-jobs/
> > >BAKLST=/mnt/backupdrive/jobs/BAKLST-temp
> > >BAKDIR=/mnt/backupdrive/jobs/
Actually, that should be simplified:
> > >BAKLSTDIR=/home/jobs/active-jobs/
> > >BAKDIR=/mnt/backupdrive/jobs/
> > >BAKLST=${BAKDIR}BAKLST-temp
The command for the zip could be:
zip -r -i@${BAKLST}.ABCD -u ${BAKDIR}jobs_A-C ${BAKLSTDIR}
That should work. Although I haven't tested it. Oh, and if you're
keeping the zip command within the for loop above, the command could be:
zip -r -i@${BAKLST}.${LETTER} -u ${BAKDIR}jobs_A-C ${BAKLSTDIR}
> Also, I thought it would be cool to add another feature. Like send an
> email to the office manager every night after completing the backups,
> with a list of the backup files created. I've never used sendmail, but
> guess it would be something like piping the results of a find command
> to sendmail, with appropriate addresses & options, etc. Is this
> doable? (It would be sending to an external account, not one served
> from this server.)
Try this:
TEMPVAR=$( zip -r -i@${BAKLST}.${LETTER} -u ${BAKDIR}jobs_A-C ${BAKLSTDIR} )
That should give you the list of files you're working with, then
something like:
( echo "List of files backed up during latest run follows:"; echo ${TEMPVAR} ) \
| mail -s "File backup summary" managersemail@somewhere.com
That should give you something to work with.
Regards,
-- dave [ please don't CC me ] --------- To unsubscribe, send email to <aklug-request@aklug.org> with 'unsubscribe' in the message body.
This archive was generated by hypermail 2a23 : Thu Feb 12 2004 - 22:39:40 AKST