1828406 Members
3570 Online
109977 Solutions
New Discussion

Linux to Solaris copying

 
SOLVED
Go to solution
Niranjan_10
Occasional Advisor

Linux to Solaris copying

Team,

I am not getting the proper syntax of the command. Basically I want to copy a file system from Solaris to Linux. Example:/oracle. The rsh from solaris to linux is working fine for root. I am using the command

#tar cvf - /oracle ; rsh 10.24.200.108 ( cd /oracle - tar xvf )
5 REPLIES 5
Roberto Polli
Trusted Contributor

Re: Linux to Solaris copying

#tar cvf - /oracle | rsh 10.24.200.108 (cd /oracle && tar xvf -)

Roberto Polli
Trusted Contributor

Re: Linux to Solaris copying

the "real cool" linux cmd is

tar cvf - /oracle| rsh 10.24.200.108 "tar -C /oracle -xvf -"

it works on Tru64 too. Don't know on solaris.

Anyway gnu-tar (aka gtar) is able to rsh automatically while tarring (ex
tar cf - solarishost:/oracle |tar -C /tgt/dir/ -tvf -

look@man

peace,r
Niranjan_10
Occasional Advisor

Re: Linux to Solaris copying

Hi Roberto,

Thanks for your reply.
If I run the below command on solaris
[tar cvf - /oracle | rsh 10.24.200.108 (cd /oracle && tar xvf -)] i am getting the following error...
"syntax error: `(' unexpected"

But the Second command works with a little modification as below..
[tar cvf - /oracle | rsh 10.24.200.108 "tar -C / -xvf -"].
With your original syntax it creates another folder by name oracle under /oracle and copies the data. Thanks for the inputs. Will rate it.
Roberto Polli
Trusted Contributor
Solution

Re: Linux to Solaris copying

just one warning: using tar in / dir. is not a real safe thing.

Check on man about using correctly the -C optins and test it untill you're really sure about its work.
Remember also that options work differently between different OS'es so always check man.

to make the parenthesis work enclose'em in ""
so

tar cvf - ./dir|rsh host "(cd /path/to1 && tar tvf -)"
should me the more platform-independent cmd

Peace, r.
Niranjan_10
Occasional Advisor

Re: Linux to Solaris copying

the last command works perfectly fine. Thankyou roberto polli