LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 05-17-2007, 04:25 AM   #1
High-gain
Member
 
Registered: Dec 2004
Location: London,UK
Distribution: Mandriva 2007
Posts: 156

Rep: Reputation: 15
Backup script


Hi There

I wonder if anyone could help me with this back up script for 2007(official)

The script works ok, but would like to convert it so that I back up my whole

system, perhaps to the Hdd, then burn to a CD-r/CDVD-r.

As a newbie I am not really sure on what to back up, or what to exclude.

I have tried drakbackup, but does not really do it for me and seems to be

very flakey. It's probably me not using drakbackup properly, so would like

something really simple and easy to use.

Here is the script - hope someone can help. Thanks.

########################################################################


#!bin/bash

#create a compressed backup of all the directories specified and put the
#resulting file in a directory of your choice

#BACKUP_DIRS="$HOME /etc /var "
#BACKUP_FILENAME=sysback-`date '+%d-%B-%Y'`
#BACKUP_DEST_DIR="/backups/sysbkup"

#tar cvzf $BACKUP_DEST_DIR/$BACKUP_FILENAME.tar.gz $BACKUP_DIRS


###################################################################


#1.Use BACKUP_DIRS to specify the directories you WANT to include in the backup

#2.Use BACKUP_DEST_DIR to specify the DESTINATION directory to store the backup

######################################################################
 
Old 05-17-2007, 04:45 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What you backup depends a bit on your setup. The basic bersion above doesn't look too bad. You may want to add /root as well

Here's by copy to dvd portion from one of my backup scripts

Code:
echo "ISO production started....";date

mkisofs -r -R -J -l -o "$BACKUP_PATH/$BACKUP_FILENAME.iso" "$DEST.bz2"

echo "mkisofs completed ";date
echo

cdrecord dev=/dev/dvdwriter driveropts=burnfree -dao "$BACKUP_PATH/$BACKUP_FILENAME.iso"

echo "Removing ISO";date
echo

rm -f "$BACKUP_PATH/$BACKUP_FILENAME.iso"
You'll need to change some variable names if you want to use it
 
Old 05-17-2007, 06:09 AM   #3
High-gain
Member
 
Registered: Dec 2004
Location: London,UK
Distribution: Mandriva 2007
Posts: 156

Original Poster
Rep: Reputation: 15
Thanks BillyMayDay for your help and also the quick reply.

If this script runs ok for me (I am sure it will) - then

what would be the best way to run this. i.e. will I have

to change any permissions? Do I put the media in the cdrom

and then execute?

Also would I need another script to restore the backup?

Silly questions I know, but am still at the early learning

center (kindergarden) Hi. Thanks again for your input.
 
Old 05-17-2007, 06:20 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Yes, you'll need media in the dvd drive (it's unlikely to fit on a cdrom)

wrt restoring, you probably don't want a script, but will want to get friendly with tar to restore
 
Old 05-17-2007, 07:40 AM   #5
High-gain
Member
 
Registered: Dec 2004
Location: London,UK
Distribution: Mandriva 2007
Posts: 156

Original Poster
Rep: Reputation: 15
Great stuff Billmayday - many thanks for your input.

In this script I am thinking of excluding the following directories -

#proc
#mnt
#temp
#the backup directory

I wonder if there would be any more that need to be excluded?

Where and how would I write that in the script?

Also, when I restore via tar, will this script 'overwrite'
the current files.

Will have to get the books out on this backup stuff, but thanks
again for helping.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup script tommytomato Linux - General 6 09-22-2006 02:41 AM
Backup Script Help Canni Programming 8 06-15-2006 10:19 AM
Backup script raptorman Programming 4 08-22-2005 09:52 AM
backup script nitaish Linux - General 1 04-22-2005 11:31 AM
Backup Script imsajjadali Linux - General 7 01-28-2004 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration