fedora backup and recovery


i have setup fedora core 3 on a dell poweredge 2600 server with internal tape backup utility. i would i set backups so that system is backed up fully everyday?

Thank you,
Who is Participating?
Do you mean it has a tape drive, or actual tape backup software?
if you don't have some kind of backup software, then you can use scripts with the 'tar' command and cron jobs to do it...

Here's a modified version of a script that I inherited from someone...author unknown
#! /bin/sh

# defines where the report and log files are

# defines which paths you want to backup, plus your tape device (note, this is for a scsi tape device)
share_paths='/usr/local/share/public /usr/local/share/projects'

# Empty the report file
> $rptfile

# Backup /home, projects share and public share to tape

echo "Backup of /home and shares to tape started: `date`" >> $rptfile
echo "----------------" >> $rptfile

cd $common_root
/bin/tar -cvf $tape $share_paths $home_path/* > $logfile 2>> $rptfile

echo "Files listed in $logfile" >> $rptfile
echo "Backup of /home and shares to tape complete: `date`" >> $rptfile
echo "----------------" >> $rptfile

# this optional part does a compare after the backup is done to help confirm the backup worked
echo "Starting compare of tape to /home and shares: `date`" >> $rptfile
echo "----------------" >> $rptfile
echo "Errors encountered:" >> $rptfile
echo "----------------" >> $rptfile

cd $common_root
/bin/tar -df $tape >> $rptfile 2>&1

echo "Compare of tape to /home and shares complete: `date`" >> $rptfile
echo "----------------" >> $rptfile

# mail the report results to root
/bin/mail -s "Backup report: `date`" root < $rptfile

Basically, that will backup /home, plus the shares defined (/usr/local/share/public and /usr/local/share/projects)...it will write a summary to a report file, and a detailed log to a log file (note the paths in there) and will write all the data to /dev/st0, assuming that is your tape device...then it emails root the report at the end.

By modifying that, you can backup anything you want. Then use cron to schedule it. Putting your script in /etc/cron.daily and making it executable will run the script every night.

To restore you can do this:
mt rewind
tar -xvf /dev/st0 <path of file to restore>

(tar -c creates an archive, tar -t will list the contents, and tar -x extracts it)
shashank3Author Commented:
great! awesome!

yes, i meant that i have a tape drive but don't know how to use it.

your script is very helpful. i was looking into using amanda which fedora provides, but this is very simple. how does this stack up against amanda?

Thank you so much.
shashank3Author Commented:
also does this automatically rewind the tape and delete everything before writing on the tape?

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

I haven't used amanda, so I can't really say...

you can add an mt rewind at the front of the script if you want. when I pop a new tape in my drive, it automatically rewinds it. also, there's no real need to 'erase' what's on the tape, the current archive will overwrite whatever's there so it's not accessible anymore. if you like, you can add an mt offline at the end to automatically pop the tape out too...
shashank3Author Commented:
great! thank you so much.

also i am doing full backup of the server. is this a good practise?
I have two separate backups...one for the 'data' which I do nightly...then the second one backs up the /etc, /root , /boot, etc and I only do that one once in a while (like after I've made changes). there are some dirs you won't want to backup, like /dev or /proc - they'll give you errors since they're not 'real files' in there...
shashank3Author Commented:
thank you.
cheers, good luck...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.