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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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?

The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

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...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.