Operating System - HP-UX
1833311 Members
3027 Online
110051 Solutions
New Discussion

Backup difference in HP-UX

 
Tieu Cong Thang
Occasional Advisor

Backup difference in HP-UX

I want to backup difference to tape in HP-UX but I can not find any command to support to do. So can You help me to solve this problem??/
Thankyou in advance
14 REPLIES 14
whiteknight
Honored Contributor

Re: Backup difference in HP-UX

Thang,

Please try fbackup, you can invoke from Sam gui

WK
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Problem never ends, you must know how to fix it
Tieu Cong Thang
Occasional Advisor

Re: Backup difference in HP-UX

Thanks for your reply but Can I using the tar command instead of fbackup command. We use tar command to backup from disk to tape so I hope that I can find the way to backup difference with the tar command
whiteknight
Honored Contributor

Re: Backup difference in HP-UX

Thang,

Sure you can use tar.

PHCO_36587 11.11 tar(1) cumulative patch

This will fix
enhance tar(1) to support the archival
of files up to 8GB from the current 2GB

WK
Problem never ends, you must know how to fix it
Tieu Cong Thang
Occasional Advisor

Re: Backup difference in HP-UX

Thanks you for your help and can you show me the systax of tar command to do difference backup in HP-UX
Dennis Handly
Acclaimed Contributor

Re: Backup difference in HP-UX

I don't think you can use tar, unless you use find and then specify each file on the command line:
$ tar -cvf file.tar $(find path -mtime days)

cpio(1) will directly take the output of find as its stdin.
Steven Schweda
Honored Contributor

Re: Backup difference in HP-UX

"tar" really wasn't intended to be used this
way, which may be why you can't find any
appropriate "tar" options to do it.
Dump-family programs ("dump" and "vxdump", on
HP-UX) were. ("man dump", "man vxdump".)

Gnu "tar" has some features to help with
this, but you'd probably need to use Gnu
"tar" exclusively to get the benefits.

http://www.gnu.org/software/tar/manual/tar.html#Incremental-Dumps

You may be able to use "find -newer" to make
a list of files which have changed since
some date-time, and then feed that list into
"tar", but you'd be making a lot of work for
yourself.

Sometimes it really helps to use the right
tool for the job, and "tar" may not be the
right tool for this job.
MarkSyder
Honored Contributor

Re: Backup difference in HP-UX

I suspect you need Data Protector which will do full and incremental backups. I think an incremental backup is what you mean when you refer to a difference backup.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
V. Nyga
Honored Contributor

Re: Backup difference in HP-UX

'We use tar command to backup from disk to tape so I hope that I can find the way to backup difference with the tar command'

Well, you also can use fbackup to write to tape, and the name 'fbackup' says much about the intention of the command - you can backup your system to tape and also do incremental backups later on.

So you should really consider to use this tool.

Volkmar
*** Say 'Thanks' with Kudos ***
Steve Post
Trusted Contributor

Re: Backup difference in HP-UX

You are looking for "backup difference to tape".
Do you mean you are looking to backup the differences between the computer as it is now and what was placed on the tape a few days ago?

This is called an incremental backup.

The fbackup command can do this for you.

Also, no one mentioned cpio. Assuming you backup everything from filesystem /utl to tape drive /dev/rmt/0m.
Command to backup all to cpio:
cd /
find ./utl -print | cpio -odumvc > /dev/rmt/0m

TO use cpio incremental, everything from the last day.
find ./utl -mtime -1 -print | cpio -odumvc > /dev/rmt/0m


Here's fbackup stuff.
# the meaning behind the flags.
#fbackup -f - the device to which output will be sent
# -0 - from the beginnning of the time (full backup)
# -u - update /utl/backups/dates -file
# -g - file that contains the list of files/directories to be included
# -I - write an index to file path
# -c - configuration file
# -d - backup dates file
# -V - volume header information

Run man pages on fbackup, cpio, and tar.

There is one bad thing about fbackup that everybody likes (except me).
An fbackup uses a whole tape. So you can fit 200 backups on a tape? No. Too bad. You can only save 1 backup per tape. But everybody likes it because of recovery speed and less digging for tapes (I think).


Mark Ellzey
Valued Contributor

Re: Backup difference in HP-UX

Tieu,

While tar itself cannot do a incremental or differential backup, I use tar on Sun systems to do incremental backups. Here's how I do it:

When I run a full backup of the machine on the weekend, once the backup is done, I write a file to a directory. This file is my 'flag file'. Then the next day, when I want to backup only the changes that have occured since the last full backup, I first search the directory for files 'newer' than the flag file. These would be any files that have been created or changed since the last backup. I write the results of the find to a file and then use that list as the source of files to backup for tar.

That's about it. Keep in mind that this is not a true incremental backup, but suffices for my needs.
Tieu Cong Thang
Occasional Advisor

Re: Backup difference in HP-UX

Thanks every one I have used the way of Dannis, I used two command
tar -cvf /dev/rmt/0mn $(find ...)
Tieu Cong Thang
Occasional Advisor

Re: Backup difference in HP-UX

Thanks every one and I have used the way of Dannis, I have used two command:
$ tar -cvf file.tar $(find path -mtime days)
TwoProc
Honored Contributor

Re: Backup difference in HP-UX

Mark, you should probably change that strategy to: creating a file just *BEFORE* the backup starts. If you're not creating the file until the backup ends, then you miss all of the files that changed *after* they were added to the backup, but *before* the file was written when the backup ended. This gap in time that you're missing could easily be 4 to 8 hours long. However, if nothing else runs during a backup (that is, all services and applications are down) and no logins are allowed, then your strategy is fine. Remember, backing up a few extra files in a backup is not a problem, but backing up too few files in a backup can be a huge problem.
We are the people our parents warned us about --Jimmy Buffett
Dennis Handly
Acclaimed Contributor

Re: Backup difference in HP-UX

>I have used two command:
$ tar -cvf file.tar $(find path -mtime days)

"days" above would probably be -days for all files modified less than days ago.

TwoProc's point is that you should creating a reference file and use -newer ref-file, instead of -days.

In both cases, this will not work if there are too many files to fit on the command line. Using pax(1) would work:
$ find path -newer ref-file | pax -w -f file.tar