If you observe regularly then these mods aren't worth the bother

rsnapshot would give depth on changes w/o dups
after initial full copy, only does complete copies of changed files


DAY=$(date -%u)   # day number eg 6 instead of Sat

mv -iv /home/backup/days/$DAY /home/backup/days/$DAY.prev

# then IF everything works ...
rm -rf /home/backup/days/$DAY.prev

Chris


On 14-04-26 11:23 PM, Shawn Grover wrote:
> This has been a great discussion thus far - I've heard about some
> tools for the first time here.  To contribute back, here is the BASH
> script I use for my backup routines.  The magic is that it doesn't
> try to be a one-stop solution for all scenarios.  Instead it expects
> each scenario to take care of itself via a separate script, and place
> it's backup files into the working directory under a reasonably named
> sub-directory.  Then it just tar's up the whole working directory...
> The depth or number of backups can be easily changed by altering the
> DAY variable.  Of course, I don't pretend this is the BEST solution
> in all cases though, so use your best judgment.  Oh and let me know
> if you see anything I can do better.. thanks!
>
> Shawn
>
> #!/bin/bash
>
> WORK=/home/backup/working SCRIPTS=/home/backup/scripts
> TARGET=/home/backup/days
>
> #make sure our directories exist [ ! -d $WORK ] && mkdir -p $WORK [ !
> -d $SCRIPTS ] && mkdir -p $SCRIPTS [ ! -d $TARGET ] && mkdir -p
> $TARGET
>
> #set up the day directory DAY=`date +%a ` rm -rf
> /home/backup/days/$DAY                   #remove the directory so we
> don't have any old backups kicking around mkdir -p
> "/home/backup/days/$DAY"               #create the "day" directory
> (i.e. Sun, Mon, Tue, etc.)
>
> echo "*************************************" >>
> $TARGET/$DAY/backup.log echo "**  Starting backup                **"
> >> $TARGET/$DAY/backup.log echo
> "*************************************" >> $TARGET/$DAY/backup.log
> echo `date` >> $TARGET/$DAY/backup.log echo ""  >>
> $TARGET/$DAY/backup.log
>
> echo "*************************************" >>
> $TARGET/$DAY/backup.log echo "**  Backup Scripts                 **"
> >> $TARGET/$DAY/backup.log echo
> "*************************************" >> $TARGET/$DAY/backup.log
>
> #execute each of the backup scripts for f in `ls $SCRIPTS` do ## Each
> Script is simply another BASH file that executes the commands ## to
> copy the desired files into the working directory. For instance ## if
> we were rsync'ing a remote website into the working directory, we ##
> would place it in $WORK/[remote_site_name]/ echo "**** Executing
> backup script: $f"  >> $TARGET/$DAY/backup.log $SCRIPTS/$f  >>
> $TARGET/$DAY/backup.log done
>
> echo "*************************************" >>
> $TARGET/$DAY/backup.log echo "**  Tar Files                      **"
> >> $TARGET/$DAY/backup.log echo
> "*************************************" >> $TARGET/$DAY/backup.log
>
> #create the tar file cd $WORK for d in `ls $WORK` do echo "****
> Creating tar file for directory: $d"  >> $TARGET/$DAY/backup.log tar
> cvzf $TARGET/$DAY/$d.tar.gz $d/  >> $TARGET/$DAY/backup.log done
>
> echo ""  >> $TARGET/$DAY/backup.log echo `date` >>
> $TARGET/$DAY/backup.log echo "*************************************"
> >> $TARGET/$DAY/backup.log echo "**  Backup Finished
> **" >> $TARGET/$DAY/backup.log echo
> "*************************************" >> $TARGET/$DAY/backup.log
>
>
> _______________________________________________ clug-talk mailing
> list [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List
> Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these
> lines when replying
>


_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to