









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] Linus would call it "bad taste".
I only skimmed your backup script, but here are some random thoughts:
% You might consider something like:
/bin/tar --bzip -cvf /backup/backup.`date +%Y%m%d`.tbz list-of-dirs
/bin/rm `find /backup -name 'backup.*' -mtime +5`
(probably needs to be tweaked for your system), assuming you can find a
"bunzip2" program for Windows.
% For reference, you can use "split" to split large files into smaller
chunks, but this won't necessarily help w/ Winzip (because splitting a
compressed file into pieces does NOT create several compressed files), but
you might be able to use it as part of a pipe-line (eg "tar | split |
bzip" or something) to help?
% Maybe keep /mnt/smb permenantly mounted?
% By default, cron will email you the output of cron jobs, and this email
could be used as your "log file"?
--
Sincerely, Sarang (sarang@sarangworld.com)
AOL Instant Messenger ID: JavaMath
Backup Email: saranghome@softhome.net
<html><img src='http://noproxy.sarangworld.com/EXP/rr.php?20040609.132140'></html>
On Wed, 9 Jun 2004, Tim Emerick wrote:
> Date: Wed, 9 Jun 2004 08:07:49 -0700 (PDT)
> From: Tim Emerick <timothyemerick@yahoo.com>
> Reply-To: New Mexico Linux Users Group Mail List <nmlug@nmlug.org>
> To: nmlug nmlug <nmlug@nmlug.org>, nmglug <nmglug@nmglug.org>
> Subject: [NMLUG] Linus would call it "bad taste".
>
> Hey all.
>
> Well, I took a stab at writing my first and very ugly script to backup some
> of my stuff on my server. I could use some serious critiquing and or
> hints/ideas. I am running it from cron every 3am using:
>
> /root/bin/backup > /backup/backup.log &
>
> I have the following issues:
>
> 1. The output is sloppy but I didn't quite know how to make a comprehensive
> log and sending the output to a log file was quick, dirty, and horrible. I
> would like a real log of the entire session as if I was at a terminal typing
> everything in....maybe with the addition of a timestamp so I could see how
> long things are taking.
>
> 2. The method that I use to grab a folder off of a WinXP machine are
> inelegant at best.
>
> 3. I had originally sent the log to /backup/1/log but the script writes over
> the old log before moving the directory it's in to a new location. How can I
> create a create the log in the /backup/1 directory without overwriting the
> log file that's already there?
>
> 4. I or another user will probably use winzip to extract anything out of the
> resulting backup.tgz file but winzip has a 4 gigabyte limit. My backup file
> has been around 16GB compressed. Can tar/gzip split up these files into <4GB
> chunks?
>
> 5. Here's the ugly mess in all it's glory:
>
> #
> # Backup Procedure.
> #
> # This backs up the /shares directory keeping a 2 day
> # live backup set for easy file recover via samba share.
> # 3 additional days are kept as a .tgz file.
>
> # I also added a backup for the pathways directory which is
> # sitting on a winxp machine.
>
>
> # Remove the oldest Backup.
> rm -f -r /backup/5
>
> # Shift everything down a day but gzip/tar the 3rd days backup
> mv /backup/4 /backup/5
> mv /backup/3 /backup/4
>
> mkdir /backup/3
> cd /backup/2
> tar cvzf /backup/3/backup.tgz .
> cd /
> rm -fr /backup/2
>
> mv /backup/1 /backup/2
>
> # Copy the shares folder to the backup directory
> cp -a /shares/ /backup/
>
> # rename to day 1
> mv /backup/shares /backup/1
>
> # also copy the /etc and /var directory
> cp -a /etc/ /backup/1/etc/
> cp -a /var/ /backup/1/var/
>
> # and the CCC pathways data
>
> mkdir /backup/1/pathways/
> smbmount //v8701-pc40/pathways$ /mnt/smb -o
> username=reliable/aig,password=password ro
> cp -a /mnt/smb/* /backup/1/pathways
> umount /mnt/smb
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
> _______________________________________________
> NMLUG mailing list
> NMLUG@nmlug.org
> http://www.nmlug.org/mailman/listinfo/nmlug
>
|
|