Remote snapshot backups with rsync and Samba
Pete Holsberg
pjh42 at pobox.com
Sat Oct 27 19:01:37 UTC 2007
From Hackzine.com:
http://www.hackszine.com/blog/archive/2007/10/remote_snapshot_backups_with_r.html
Remote snapshot backups with rsync and Samba
Thanassis Tsiodras writes:
What would you do if you had to automatically backup a remote Linux
box (e.g. your web server), and all you had locally was Windows
machines? How about this:
1. automatically expanding local storage space
2. transmissions of differences only
3. automatic scheduling
4. local storage of differences only
5. secure and compressed transfer of remote data and
6. instant filesystem navigation inside daily snapshot images
I covered all these requirements using open source tools, and I now
locally backup our 3GB remote server in less than 2min!
We've all used Samba and rsync before, but Thanassis has really put all
the pieces together into a complete backup system that's superior to a
lot of commercial products I've seen.
The really impressive bit is how he's easily doing snapshot images using
filesystem hardlinks. You can save several days worth of snapshots at
very little cost because additional space is only taken up by files that
have changed. Using hardlinks, identical files from different snapshots
all point to the same inode.
||
root# mount /dev/loop0 /mnt/backup
root# cd /mnt/backup
root# rm -rf OneBeforeLast
root# cp -al LastBackup OneBeforeLast
root# cd LastBackup
root# rsync -avz --delete root at hosting.machine.in.US:/ ./
The "cp -al" creates a zero-cost copy of the data (using hardlinks,
the only price paid is the one of the directory entries, and
ReiserFS is well known for its ability to store these extremely
efficiently). Then, rsync is executed with the --delete option:
meaning that it must remove from our local mirror all the files that
were removed on the server - and thus creating an accurate image of
the current state.
*And here's the icing on the cake:* The data inside these files are
not lost! They are still accessible from the OneBeforeLast/
directory, since hard links (the old directory entries) are pointing
to them!
In plain terms, simple navigation inside OneBeforeLast can be used
to examine the exact contents of the server as they were BEFORE the
last mirroring.
Just imagine the data recovery headaches you could solve by adapting
that to a cron job that shuffles a months worth of nightly backups.
Optimal remote Linux backups with rsync over Samba - Link
<http://ttsiodras.googlepages.com/backup.html>
--
Pete Holsberg
Columbus, NJ
Only a mediocre person is always at his best...
-- W. Somerset Maugham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20071027/2d758e7f/attachment.html>
More information about the ubuntu-users
mailing list