Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup to extra HD script help 1

Status
Not open for further replies.

wraheem

MIS
Jul 19, 2001
62
US
We have been using tar to backup and recover important files. Even though we hardly ever have to do recoveries when we do need them we need them ASAP. The tar job normally takes up to 2 hours to recover the files which is unsatisfactory to the users that needs them. So we came up with the following solution:

We bought (and it is on order) another HD that we will create 2 LV's on. Every night we will copy our important working LV to LV1 and delete whats on LV2. Basically make a backup of the working LV and delete the copy that's older than 2 days, since the users never need a copy older than 2 days for whatever reason. That way we can just mount the copy LV and grab the files we need saving hours.

I was currently using HP-UX 10.x and Linux (csh) so I am having a time trying to right this script using AIX's commands and the korn shell. It doesn't help that I'm not the best scripter to begin with.

We don't have the HD in yet so I can't test the little bit of script that I do have. If someone could lend a hand or if they know of someone who has already done this (why re-invent the wheel?) please respond.

This is what I have thus far (Don't laugh I know it's wrong ;->)

mount /dev/hd3 /mnt/hd3/one;
mount /dev/hd3 /mnt/hd3/two;

/rm –r /mnt/hd3/one/*;
mv /mnt/hd3/two/* /mnt/hd3/one/;

mkdir /mnt/hd3/two/usr;

cp /usr/stuff/* /mnt/hd3/two/usr;
cp /usr/stuff2* /mnt/hd3/two/usr;
cp /usr/stuff3/* /mnt/hd3/two/usr;


Thanks in Advance

Wali
 
Just a suggestion, continue to use tar to do the backups/restores, but instead of using a tape device (-f /dev/rmt0), use a file device.. -f /mnt/hd3/2003-04-28.tar
 
I guess I wasn't descriptive enough; we keep the backups for a year, but when the users need a recovery it is never longer than 2 days.

But doing a tar backup directly to the new LV's is a good idea that I didn't think of...maybe I could run the tar to both the tape and the extra HD. But I would still need help with the script to mount the LV and move the tar packs around.

Thanks!!!
 
We do a similar approach as what you're asking. We have a dedicated hdisk with a large file system enabled lv on it. Then our backup script uses IBM's backup utility and looks something like this:

find {path} {include expression} -print | backup -ivqf/lv00/backupfilename;

Then the next line does this:

dd if=/lv00/backupfilename of=/dev/rmt0 obs=51200 &

What this does is perform a backup to the specially defined logical volume which runs quite quickly even with large amounts of data and files. Upon completion it then starts a backup of the file just created being written to tape in a format that is directly readable by IBM restore utility on this or any other AIX system. The dd to tape runs in the backup so the regular processing can continue without delay.

Our implementation of this technique dropped a 3 hour nightly backup down to about 30 minutes (not counting the writing to tape - which doesn't matter because it run concurrently with resumed production.

And, restore one, many or all files can be performed from either the file on disk OR the tape.

Hope this helps your concept.

Bob
 
Thank you, I believe you may have solved our little problem.


Wali
 
I'm attempting to do a similar script but keep getting an error 0511-432 A write error occurred: A system call received a parametr that is not valid.

The command I am using is backup -ipqf/volume/filename.

The volume is a NFS volume on a NAS device.
I am getting a partial backup only. I do a file count from root down and then read the backup file names back and do a compare to check for missing files.

I'm thinking it is a session limit even tho root has unlimited filesize. The script is a cron job. I thought cron uses the system limits of root but may be using defaults.
Anybody have an idea to get around this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top