- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Tar trouble!
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
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
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
01-25-2002 06:54 AM
01-25-2002 06:54 AM
I have two machines and need to copy the home area of one and transfer it to the other. Basically, I have tried to tar the home using the following command.
tar -cvf /home/home.TAR /home
However, this tars fine until it trys to tar the actually tar I am making and so fills the up the home area and runs out of space. I have tried to tar it to a different file system such at /tmp but there isn't enough space in there and that then fills up. How can I tar the home area with out the tar file getting stuck tarring itself?!
Oh and I cant stick it on a tape either!
Can I make a list of all the file names or something and then make the tar read the names of these files and tar the files, maybe?!!
Many thanks, David,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:02 AM
01-25-2002 07:02 AM
Re: Tar trouble!
go to /
run > tar -cvf /home/home.tar /home
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:02 AM
01-25-2002 07:02 AM
Re: Tar trouble!
If you have NFS configured on the system, then mount the other /home file system on your original server and copy the files using cp, cpio etc.
eg: find /source_dir -depth | cpio -pdlmuva /dest_dir
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:03 AM
01-25-2002 07:03 AM
Re: Tar trouble!
tar -cvf home.tar /home
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:03 AM
01-25-2002 07:03 AM
Re: Tar trouble!
# tar cvf /tmp/home.TAR /home
If that is the case and you still don't have room, try to find another filesystem with room, increase /tmp, if possible.
How about rcp?
Just my thoughts, hope they help
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:07 AM
01-25-2002 07:07 AM
Re: Tar trouble!
You can use the wildcard * instead. As long as you can perform
# ls /home/*
then this will work.
If you use the wildcard *, the shell will expand it before the tar gets executed.
# tar -cvf /home/home.TAR /home/*
This will prevent home.TAR from tar'ing itself subsequently.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:08 AM
01-25-2002 07:08 AM
Re: Tar trouble!
Unfortunately I cant extend the filesystems, there not my machines. I was hoping there would be an easier solution than extending them all.
I am doing the tar from outside the home directory,
tar -cvf /home/home.TAR /home
And yes when I was in /tmp I did
tar -cvf /tmp/home.TAR /home
Cheers fo all your helps,
points coming soon!
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:09 AM
01-25-2002 07:09 AM
Re: Tar trouble!
with the combination of find and cpioyou can get it work like this:
find /home ! -name home.CPIO -depth | cpio -oc >/home/home.CPIO
On the other machine do:
cpio -imdc
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:11 AM
01-25-2002 07:11 AM
Re: Tar trouble!
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:12 AM
01-25-2002 07:12 AM
Re: Tar trouble!
If this doesn't work will the wildcard command transverse througout symbolic links to other machines? The home directory has about 10 different links to different machines, which I dont want to be added to the tar?
Thanks all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:14 AM
01-25-2002 07:14 AM
Re: Tar trouble!
One way:
# create the tar
find /home -type f | head -1 | xargs tar cvf /home/home.TAR
# then add the rest...
find /home ! -name "home.TAR" -type f | tail +2 | xargs tar rvf /home/home.TAR
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:17 AM
01-25-2002 07:17 AM
Re: Tar trouble!
tar cvf - /home | gzip > /tmp/home.tar.gz
This should save a lot of space and time.
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:19 AM
01-25-2002 07:19 AM
Re: Tar trouble!
Do a 'bdf' and findout a file system which has free space on it. Then try a tar.
# tar -cvf /test/home.tar /home
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:22 AM
01-25-2002 07:22 AM
Re: Tar trouble!
If you have other filesystems such as nfs-mounted filesystems within /home, then:
# tar cvf home.tar `find /home -xdev -print`
-xdev will prevent the files in other filesystems other than /home from being listed.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:27 AM
01-25-2002 07:27 AM
Re: Tar trouble!
I tried tar'ing from outside the directory - same problem, the tar tries to tar itslef fills up /home.
/home is the largest filesystem on the machine with 600mb of data out of 1GB.
The wildcard solution didn't work because I couldn't do a ls /home/*.
The CPIO command didn't work wither.
How can I do rcp?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:33 AM
01-25-2002 07:33 AM
Re: Tar trouble!
the use of rcp could be:
rcp -rp /home
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:33 AM
01-25-2002 07:33 AM
SolutionCheck this out for help in rcp:
http://www.docs.hp.com/hpux/onlinedocs/B2355-90148/B2355-90148.html
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:35 AM
01-25-2002 07:35 AM
Re: Tar trouble!
rcp -rp /home/directory2Bcopied remothostname:/home
like this:
cd /home
rcp -rp ./harry otherhost:/home
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:37 AM
01-25-2002 07:37 AM
Re: Tar trouble!
First make a /.rhosts file on both machines(if doesn't exist)
add the following entries:
root host1
root host2
save it. Also, make sure that the entries for login, shell and exec are not commented out in your /etc/inetd.conf and /etc/services files. If they are, uncomment them and run inetd -c.
then on host1:
# rcp /home/* host2:/home
Hope this helps
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:38 AM
01-25-2002 07:38 AM
Re: Tar trouble!
Good luck
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:51 AM
01-25-2002 07:51 AM
Re: Tar trouble!
>> The home directory has about 10 different links to different machines, which I dont want to be added to the tar?
Since you have 10 different links to different machines, what is preventing you from creating one more link to just this one more machine you need to copy the data to? :)
Once the link is created, you can simply use cp or cpio (as indicated in above posts) to copy over direct.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 08:00 AM
01-25-2002 08:00 AM
Re: Tar trouble!
try this one:
tar cf - /home | compress > /tmp/compressed_tar_file.tar.Z
Reverse ( extract):
uncomppres /tmp/compressed_tar_file.Z | tar xf -
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 08:05 AM
01-25-2002 08:05 AM
Re: Tar trouble!
tar cf - ` find /home -xdev -type f ` | compress .....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 08:07 AM
01-25-2002 08:07 AM
Re: Tar trouble!
Another idea
From the one machine:
cd
tar cf - . | remsh
The first
from the source machine. The
machine. The second
to on the destination machine.
If you do not care about using tar or the intermediate writing to tape,
then using ftp(1) or rcp(1) to copy files between remote systems is easier
than the procedure outlined above.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2002 08:13 AM
01-26-2002 08:13 AM
Re: Tar trouble!
I know you got a lot of replies to your question and sense you may have been getting confused. I'll try to answer the questions you raise concerning tar.
By the way, if you're not running as superuser, the last paragraph below is going to tell you all you need to know.
<
rm /home/home.TAR
tar -cvf /home/home.TAR /home/*
This tells tar the input files are every file and directory in /home. The wildcard "*" is expanded by the shell then passwd to the tar command. You must remove /home/home.TAR first or it will be seen when the shell expands the wildcard.
If you have some files or directories in /home (not its sub-directory structure) then you could append " /home/.[0-9a-z]*" to the tar command line. Don't specify .* because that would include your current and parent directories as well.
<
Yes, but I believe using wildcards as above is more straight-forward.
<tar -cvf /home/home.TAR /home>>
Since you specify the absolute paths, it doesn't matter which directory you cd into before running this command. The archive will still be in /home and you are specifying the input to be the entire /home structure. home.TAR will be created then included in the archive (as you have discovered).
<
man tar says that the default behavior of tar is to not follow symbolic links. This means your symlinks will be archived, not the files they point to. Use -h to for tar to follow symlinks.
<
If this means that 600MB is used, then tar by itself is going to fill up /home. tar is an archival tool, not a compression tool. However, using Craig's suggestion along with Steven's will probably save enough space to work:
rm /home/home.TAR
tar -cvf - /home/* | gzip >/home/home.TAR.gz
The "-" after cvf tells tar to use standard output as the archive file. That is piped to gzip which compress it and save the output to /home/home.TAR.gz.
The easiest way to extract the contents of home.TAR.gz is:
gzip -dc home.TAR.gz | tar -xvf -
This save space as the decompression is performed inline and not written to disk.
<
If you can not list the contents of /home's sub-directories, then you aren't going to be able to archive them. Are you running as superuser? If not, forget the whole thing. You don't have the appropriate permissions!
Darrell