Re: Does tar have list files or option files?
- From: Douglas Mayne <doug@xxxxxxxxxxxxxxxxx>
- Date: Mon, 05 Mar 2007 07:46:24 -0700
On Mon, 05 Mar 2007 04:48:41 -0800, voipfc wrote:
On 28 Feb, 22:00, Douglas Mayne <d...@xxxxxxxxxxxxxxxxx> wrote:This thread from last month asked a similar question. Follow the thread
On Wed, 28 Feb 2007 13:48:55 -0800,voipfcwrote:
Does tar have an option for getting the archives from a list,
switch: -T
like a
list of directories, file wildcasrds to add
or exclude
switch: -X
from the list to be archived?
Note: comments inline.
man tar. There are a lot of options. It definitely requires practice to
ensure it will do what you want.
--
Douglas Mayne
What I am looking for is a canned tar command with option files which
can be used to backup a complete server for restoration later,
possibly on different hardware, but to exclude some files and
directories which are not necessary in that instance.
Are there any examples in the wild?
starting here:
http://groups.google.com/group/comp.os.linux.setup/msg/93212f8e67d47f8d
In general, the hard drive upgrade mini howto shows multiple examples of
how to do this:
http://tldp.org/HOWTO/Hard-Disk-Upgrade/index.html
Below, I show a related example of how to backup over the network using
nc and tar. This is a fairly easy way to make a snapshot backup. Notice
that the steps necessary to prepare for the backup are more complicated
than the backup itself. The tar commands are shown in step 4. A canned
method would likely have to deal with these same setup issues. A live CD
with networking capabilities is a good platform for performing this
operation.
Warning: Be careful when working directly with the filesystem when
making backups or restoring. The operations shown below can do great
damage to your system if you make a mistake, or if you mistype a command.
Verify commands and values are appropriate for your system, and that I
haven't made any errors, etc.
1. Boot a live CD (or equivalent) on the source and destination computer.
Login as the root user.
2. Mount the hard disk partitions which need to be backed up. For this
example the source computers file system is totally on hda1. It will be
copied to a similar computer, but using a different hard disk controller;
the target partition is hde1.
a. Source partition, /dev/hda1, mounted at /mnt/hd
b. Target partition, /dev/hde1, mounted at /mnt/hd
3. Start networking and get a network address if necessary. For
this example the addresses are as follows:
a. Source Address: 192.168.0.1
b. Target Address: 192.168.0.2
(Also, make sure firewall is not blocking the local network on the target
box, if applicable.)
4. Backup/Restore
a. Listen on target box for data from source.
First, at target's command line:
# nc -l -p 1234 | (cd /mnt/hd && tar -xpv --numeric-owner -f -)
b. Send data from source.
Next, at source's command line:
# nc -w 2 192.168.0.2 l234 | (cd /mnt/hd && tar -cp --numeric-owner -f - .)
Then wait for backup to complete.
5. Fixup /etc/fstab on the target box to reflect the hard disk controller
(not shown)
6. Fixup bootloader on the target box (not shown.) For this example, I
would install the grub loader on the MBR and fix the file
/mnt/hd/boot/grub/menu.lst to update the _kernel's_ root parameter.
7. Test boot on backup hardware. (not shown.)
--
Douglas Mayne
.
- Follow-Ups:
- Re: Does tar have list files or option files?
- From: voipfc
- Re: Does tar have list files or option files?
- References:
- Re: Does tar have list files or option files?
- From: voipfc
- Re: Does tar have list files or option files?
- Prev by Date: Re: Reserving space in ext2 or ext3 for a big file.
- Next by Date: Re: Does tar have list files or option files?
- Previous by thread: Re: Does tar have list files or option files?
- Next by thread: Re: Does tar have list files or option files?
- Index(es):
Relevant Pages
|