LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Backup strategy (http://www.linuxquestions.org/questions/linux-networking-3/backup-strategy-383630/)

xpucto 11-16-2005 06:57 AM

Backup strategy
 
Hi!

I decided a few days ago to make regular Backups from my server. I wrote a small script that uses rsync and through crontab I make an incremental Backup every 10 minutes.

My script looks like this:
Code:

#!/bin/bash

# no --delete-after

rsync -e ssh -alpogtvz /home/christophe/Documents 111.111.00.00:/home/christophe/Backup-Laptop-root/ > /home/christophe/Administration/Backups/protokoll-laptop-root

Every thing works just fine. But I realized that in case my computer gets some virus that destroys or changes some files then my backup will save the corrupted files!

What is a good Backup-Strategy? The server is 180 GB big and I wanted to make regular backups and also have a second server as miror server. But how can I have regular Backups and at the same time avoiding to have my backups corrupted through some corrupted files?

Can any administrator tell me what is his/her Backup-strategy?

Thanks.

XpucTo

sopiaz57 11-16-2005 11:59 AM

append
 
i would suggest appending something to each backup and cycle through every month or something.

for example,


rsync -e ssh -alpogtvz /home/christophe/Documents 111.111.00.00:/home/christophe/Backup-Laptop-root.`date`/ > /home/christophe/Administration/Backups/protokoll-laptop-root

msound 11-16-2005 12:19 PM

Quote:

i would suggest appending something to each backup and cycle through every month or something.
Agreed.

There's nothing wrong with syncing a server with a mirror. It's just a good idea to include an archive backup, in case the problem on the server gets replicated to your mirror before its caught.

So in your script that runs rsync, include something like this:

Code:

setDate=$(date +"%m%d%Y-%k%M%S")
echo "Creating archive..."
tar -cpvf /home/christophe/archives/Documents-$fileDate.tar /home/christophe/Documents/*
echo "Compressing archive..."
gzip -v /home/christophe/archives/*.tar

The code above will make a compressed archive of your Documents folder and append the current date and time to the end of the file name. Now if you screw up a file, and it gets replicated to your mirror (thus overwriting your backup) before you catch the problem, you'll still have a good copy of the file intact in one of your compressed archives.


All times are GMT -5. The time now is 10:00 PM.