- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to use tar command to run differential backup?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 12:57 PM
тАО09-22-2008 12:57 PM
I use tar command to run daily full backup on file systems on a SAS9 DI server. My users would like to have real-time backup on their SAS data folders. How to use tar command to run differential backup so it won't take longer time copy data? Thanks.
Regards,
Jan Shu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 03:03 PM
тАО09-22-2008 03:03 PM
Solutioncapability in the standard HP-UX "tar"
program. Have you considered using "cpio" or
GNU "tar"?
If you can devise a "find" (or other) command
which will identify the files you wish to
archive, then you can feed those names into
"tar" (or, perhaps more easily, into "pax").
It's often helpful to disclose your OS (and
its version).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 03:13 PM
тАО09-22-2008 03:13 PM
Re: how to use tar command to run differential backup?
The HP-UX proprietary (but free) 'fbackup'/'frecover' utilities allow you to setup incremental backups. Be advised that they are deprecated beginning with 11.31, however ( a real shame, in my opinion ).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2008 04:41 AM
тАО09-23-2008 04:41 AM
Re: how to use tar command to run differential backup?
Thanks for the reply. This server has HPUX 11.23 OE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2008 04:42 AM
тАО09-23-2008 04:42 AM
Re: how to use tar command to run differential backup?
Thanks for the info. I will take a look the fbackup. I think it is in SAM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 04:47 AM
тАО09-24-2008 04:47 AM
Re: how to use tar command to run differential backup?
You get a list of files via
find / -print > mybiglist.txt
Now what if you had a file from the last backup time? Like.... /utl/backups/lasttime
find / -newer /utl/backups/lasttime -print > mybiglist_inc.txt
So....
Level 0 backup.(everything)
1. make a list of all files.
2. backup from the list.
3. make a file called /utl/backups/lasttime via the touch command.
Level 1 backup.(everything since the last backup)
1. make a list of all files newer than "lasttime".
2. backup from the list.
3. make a file called /utl/backups/lasttime via the touch command.
Note I didn't mention the tar syntax? I use cpio.
It would be....
cat mybiglist.txt | cpio -odumvc > /dev/rmt/0m
Tar can do this..uh...right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 05:04 AM
тАО09-24-2008 05:04 AM
Re: how to use tar command to run differential backup?
Thanks for the find and cpio commands. How to restore data from above backup files? Do I restore from the backup_0 and then the backup_newer? Thanks.
Regards,
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 05:36 AM
тАО09-24-2008 05:36 AM
Re: how to use tar command to run differential backup?
To backup with cpio to a tape drive called /dev/rmt/0m. I'll assume you have a full backup on a tape, and an incremental backup on the same tape, after the full.
find / -print | cpio -odumvc > /dev/rmt/0mn
To recover file /tmp/junkdir/billybob.txt from the first, full backup:
1. The proper path of billybob.txt needs to be known. If you try to recover ./tmp/junkdir/billybob.txt, it won't find it. If you try just billybob.txt, it won't find it.
So you do this....
cpio -itdumvc < /dev/rmt/0m > cpio.filelist
Note the "t" here. This t is for "table of contents". It's a listing of the files.
Then...
grep billybob.txt cpio.filelist
This shows it as /tmp/junkdir/billybob.txt
I always worry about recovering from root. So I don't do it. I recover on a big junk directory and move it after the fact.
cd /bigjunkdir
cpio -idumvc < /dev/rmt/0m /tmp/junkdir/billybob.txt
This makes file /bigjunkdir/tmp/junkdir/billybob.txt
I next copy billybob.txt to its proper place and get rid of directory /bigjunkdir/tmp.
What about incremental recovery? It's still recovery. Perhaps you want incremental and full backups on the same tape?
You can't do that with fbackup/frecover. You can do that with cpio.
mt -f /dev/rmt/0mn rewind
this rewinds the tape
mt -f /dev/rmt/0mn fsf 1
This moves the tape past the first backup on the tape. I'll assume it is a full backup.
At this point, I'll assume you have your incremental backup.
Run that "cpio -itdumvc < /dev/rmt/0mn" to get a list of what is on the second backup on the tape, aka the incremental backup.
Note the "n" in /dev/rmt/0mn tells the tape to NOT rewind when it is done.
Ok......
cd /bigjunkdir
mt -f /dev/rmt/0mn rewind
mt -f /dev/rmt/0mn fsf 1
cpio -itdumvc < /dev/rmt/0mn > filelist
grep billybob.txt filelist
Now I know I want to recover "/tmp/junkdir/billybob.txt"
mt -f /dev/rmt/0mn rewind
mt -f /dev/rmt/0mn fsf 1
cpio -idumvc < /dev/rmt/0mn /tmp/junkdir/billybob.txt
Now the incremental billybob.txt file showed up in /bigjunkdir/tmp/junkdir.
mt -f /dev/rmt/0mn rewind
Now the tape is rewound.
The thing is...you need to know that the first thing on the tape is the full backup with cpio, and the second thing is the incremental backup with cpio. You can find this out with that "mt" command and "cpio -idtumvc" command.
Now....forget about cpio and use fbackup/frecover. You can only store one backup on a tape. But it is easier and faster. Let me know if you want some help on that. I think I have typed way WAY too much here!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 05:39 AM
тАО09-24-2008 05:39 AM
Re: how to use tar command to run differential backup?
Thanks for the info. I will try this on my development server. Thanks.
Regards,
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 08:12 AM
тАО09-24-2008 08:12 AM
Re: how to use tar command to run differential backup?
And REALLY now....
fbackup and frestore is a better way to go.