LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-28-2004, 04:19 AM   #1
imsajjadali
Member
 
Registered: Jan 2004
Location: Faisalabad-Pakistan
Distribution: Red Hat Linux 2.1 Advance Server
Posts: 102

Rep: Reputation: 15
Backup Script


can any body provide me the backup script on hard drive or tap.

Thanks in advance
 
Old 01-28-2004, 06:48 AM   #2
chrisk5527
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Slackware Linux 10.0
Posts: 289

Rep: Reputation: 30
Just do something like:

Sunday
/sbin/dump -0f -u /dev/hda1 /dev/tape

Monday
/sbin/dump -9f -u /dev/hda1 /dev/tape

Tuesday
/sbin/dump -8f -u /dev/hda1 /dev/tape

Wednesday
/sbin/dump -7f -u /dev/hda1 /dev/tape

Thursday
/sbin/dump -6f -u /dev/hda1 /dev/tape

Friday
/sbin/dump -5f -u /dev/hda1 /dev/tape

Saturday
/sbin/dump -4f -u /dev/hda1 /dev/tape


Good Luck man.
 
Old 01-28-2004, 07:12 AM   #3
imsajjadali
Member
 
Registered: Jan 2004
Location: Faisalabad-Pakistan
Distribution: Red Hat Linux 2.1 Advance Server
Posts: 102

Original Poster
Rep: Reputation: 15
dear, your script does not solve the problem. I want to automate backup of my /home directory on to tap drive at 23:00 hours. Please give the complete script and changes required in crontab....thanks
 
Old 01-28-2004, 07:30 AM   #4
chrisk5527
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Slackware Linux 10.0
Posts: 289

Rep: Reputation: 30
That script does do it, figure it out for yourself. I'm done here
 
Old 01-28-2004, 07:30 AM   #5
chrisk5527
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Slackware Linux 10.0
Posts: 289

Rep: Reputation: 30
And whats a "tap" drive?
 
Old 01-28-2004, 07:33 AM   #6
imsajjadali
Member
 
Registered: Jan 2004
Location: Faisalabad-Pakistan
Distribution: Red Hat Linux 2.1 Advance Server
Posts: 102

Original Poster
Rep: Reputation: 15
Tap drive normaly used in all os for backup..same as cd rom
 
Old 01-28-2004, 07:40 AM   #7
chrisk5527
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Slackware Linux 10.0
Posts: 289

Rep: Reputation: 30
Dont you mean a tape drive?

Well my script will work above.

You need to type "df" at the command line (without the double quotes) to figure out what partition /home is on. Lets say its on /dev/hda1. Then what you would do is edit your crontab (crontab -e) for
00 23 * * * /pathofscript/backupscript

Then in the backupscript you'll want
/sbin/dump -0u -f /dev/hda1 /dev/tape
 
Old 01-28-2004, 03:30 PM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Here is an example of making backups to a second hard drive. You can change that to use a tape drive also.
You can change the names to meet your needs...

mkdir -p /mnt/backup
mount /dev/hdb1 /mnt/backup -t ext3


Edit the /etc/fstab to mount that directory every time you reboot
/dev/hdb1 /mnt/backup ext3 defaults 0 0

Make a text file called backup.job with these lines in it.
#!/bin/bash
filename=`date '+%m%d%y'`
tar -cvzf /mnt/backup/${filename}.tar.gz /home


Make the file executable with the command:chmod +x backup.job
Put the file into the /mnt/backup directory so you know where to look for it.

type the following commands:
export EDITOR=vi
crontab /etc/crontab
crontab -e


That will open up your personal crontab which you can edit to include your job....
Press the Insert key
Go to the next free line and add your backup job....
00 23 * * * /mnt/backup/backup.job


To save the changes....
Press the Esc key
Type :wq!


Now you should have a backup job ready to go.

Last edited by homey; 01-28-2004 at 04:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup script raptorman Programming 4 08-22-2005 09:52 AM
What backup script do you use? buldir Linux - Software 1 04-12-2005 02:57 PM
Need a backup script enygma Linux - General 5 11-04-2004 03:49 PM
Script Backup Buto Linux - General 2 10-18-2004 05:56 PM
help with backup script dennis_89 Linux - Networking 2 06-29-2004 09:47 AM


All times are GMT -5. The time now is 02:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration