[TriLUG] rsync script

Jeremy Portzer jeremyp at pobox.com
Fri Apr 4 11:56:26 EST 2003


On Fri, 2003-04-04 at 10:28, John Beimler wrote:
> JoJo Almario wrote:
> 
> > Im bad at putting out scripts with anything other than simple 
> > commands. What I was looking for was a script in bash or perl that 
> > would allow me to rsync a folder...lets say /home/users to a space  
> > /backup/users while excluding any files with the extension " *.bkf" 
> > It sounds like it would be simple but I havent been diligent in 
> > learning my programming or scripting.
> >
> not really a script, but here:
> 
> rsync -av --delete --exclude '*.bkf' /home/users /backup/users
> 
> you may want to look at the snapshot article and scripts at 
> http://www.mikerubel.org/computers/rsync_snapshots/
> 

If you want to go the snapshot route (which *rules*!), that article has
a number of links at the bottom for software to handle the snapshot
stuff.  The one I prefer is a perl script called "rsback" at 
http://www.pollux.franken.de/hjb/rsback/

We're using that on the TriLUG backup server, chiana, to backup home
directories and mail spools every 4 hours, as well as daily and weekly. 
The space needed by snapshot backups depends on how often stuff changes
(and how big the files are that change), but right now the backup drive
only uses about 15% more space than one copy of the data, which is
really efficient, given the number of snapshots.

One drawback to the "rsback" script is it doesn't handle changing
filesystem very well -- if a file gets deleted "out from under" it, it
croaks.  To really solve that problem, you'd have to use something like
the LVM snapshot stuff to get an instant snapshot of the filesystem. 
Then you could copy that instant snapshot using rsback or rsync, and
tell LVM to "release" the snapshot when you're done copying.

--Jeremy

/=====================================================================\
| Jeremy Portzer       jeremyp at pobox.com       trilug.org/~jeremy     |
| GPG Fingerprint: 712D 77C7 AB2D 2130 989F  E135 6F9F F7BC CC1A 7B92 |
\=====================================================================/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20030404/241cc3d2/attachment.pgp>


More information about the TriLUG mailing list