1827367 Members
5811 Online
109963 Solutions
New Discussion

Tar trouble!

 
SOLVED
Go to solution
Steven Sim Kok Leong
Honored Contributor

Re: Tar trouble!

Hi,

There is another circumstance under which the wildcard * will not work and that is when your argument list is too long. The OS has a limit to the number of arguments it can expand the wildcard to. If you exceed this limit, you will encounter the following error message:

"Argument list too long"

Hope this helps. Regards.

Steven Sim Kok Leong
Chris Vail
Honored Contributor

Re: Tar trouble!

If the source and destination directories are on the same host, or hosts with mounted NFS directories, here's the classical approach:
tar cvf - .|(cd /DESTINATION;tar xvfp -)
This reads the current directory (the dot to the left of the | (pipe) symbol) and writes the result to standard output (the - (dash)). To the right of the pipe, the cd command moves standard output to the destination directory, and the tar xvfp - command reads from standard input and writes to the current directory.
With this method, you will not have to create ANY file, but use standard input and output instead of a intermediary tar file.
A nifty aspect of this is the extreme speed at which the data is copied. I just used this very command a couple of hours ago to move Oracle's home directory from one disk drive to another, as the old drive was being replaced. Once the move was made, I demounted the old disk and mounted the new one in the same place. This also keeps ownership, permissions and timestamps intact, which is very important for Oracle files.
david heath_3
New Member

Re: Tar trouble!

What u should do it type

rm /home*
Joseph C. Denman
Honored Contributor

Re: Tar trouble!

Wow, What a lot of responses. David, has your problems been fixed?

How about...

cd /home
#If that messed up tar exist, remove it
files=`ls`
tar cvpf - `echo $files` | gzip > home.TAR.gz

That should resolve your problem.

...jcd...
If I had only read the instructions first??
Tim D Fulford
Honored Contributor

Re: Tar trouble!

This answer could be above I only scanned the thread

I assume you really want to move the /home filesystem to another computer, if so

on target m/c
remsh tar cf - /home | tar xvf -

If you just want home.tar (a tar of /home) on another computer try

on target m/c
remsh tar cf - /home > /home/home.tar

Tim
-