how to copy tar file to other location
Hi Experts,
I have used tar cvf to copy a file to /u03 location. the command which i run to copy. cd /u03 tar cvf apps_st.gz /u01/oracle/oradev/apps/apps_st u03- where i wanted to copy. apps_st while i wanted to copy. Is this is the correct copy command using tar. Now i want to extract it to /u02/backup which command i used? Your assistance is much apprecited in this regards, Thanks and Regards, |
Hmm,
How about this? Quote:
Hopefully helpful... Thor |
Hi,
Thanks for the quick response. In my case, If i want to copy it to /u02/backup. I have to use the below command. tar -xvf /u03/apps_st.gz -C /u02/backup Please advice. one more thing my command was correct which is used to copy using tar. Please advice. Thanks and Regards, |
you forgot the "z" option, I see this is a .gz (read Zip - hence the "z")
Try this instead: Quote:
The given command assumes folders u03 and u02 to be in the top level, this is not a very clever idea...you may (as normal user) not even have the permissions to do that, if so, you may need to use sudo: Quote:
If, however,these are located in your home folder (say), I'd add the full path Quote:
Thor |
Hello Dear
Assuming your "apps_st.gz" achieve is still located in /u03, You can extract it to "/u02/backup" by using any of the following option cd /u02/backup tar -xvzf /u03/apps_st.gz Or Simply tar -xvzf /u03/apps_st.gz -C /u02/backup ~thalha~ |
@daniesh:
Why are you using tar to copy files ? What OS and what tar version are you using ? |
Quote:
|
Quote:
|
Are you wanting to just copy files from one place to another maintaining permisssions?
to copy files from your current dir to another dir: tar Ecf - . | ( cd /directory/where/you/want/to/copy2; tar xfp -) And Solaris does not support the z option like Linux does. :( |
Quote:
|
Hi,
Thanks for all your assistance. The command i have used is tar cvf. the name i have given only the name as name.gz format, howver i have not used z in my tar command.I can used tar c /location where i want to copy/ tar xcf. Thanks and Regards, |
@daniesh
Is you final goal to create a tar archive file, or to copy files? |
Hi,
I have already take a backup using above tar command. Now i just wanted to copy to different location, thats it. Thanks and Regards, |
As you have stored a non relative path in your archive, you can't restore it to a different location with a regular Unix tar. Gnu tar is ignoring the leading slash so that might be a solution but you might be hit by compatibility issues.
With regular Solaris tools, you can restore a tar archive elsewhere by using the pax command. For example this command extracts to the current directory all the files present in your tar file, removing its hierarchy: Code:
pax -r -s '/.*\///' -f apps_st.gz |
Hi All,
Thanks for all your help. I tried to command to copy apps_tar.gz to /u02/oracle/ERPTEST/appltest/ using the below command. tar -xvfp /u03/backup_23042011/apps_tar.gz -C /u02/oracle/ERPTEST/appltest/ I can see the below output. x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423192.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423306.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420192.req, 1509 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420171.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422535.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422653.req, 2711 bytes, 6 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423194.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423307.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420190.req, 1509 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420191.req, 2273 bytes, 5 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422537.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422646.req, 4521 bytes, 9 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423187.req, 2253 bytes, 5 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423298.req, 2253 bytes, 5 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420197.req, 2253 bytes, 5 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420200.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422529.req, 4521 bytes, 9 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422657.req, 2591 bytes, 6 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423189.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423310.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420095.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420096.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422585.req, 4521 bytes, 9 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422601.req, 1996 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423242.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423259.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420198.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420199.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422532.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422656.req, 2802 bytes, 6 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423191.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423311.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420202.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420203.req, 1517 bytes, 3 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422530.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l422658.req, 2802 bytes, 6 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423190.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l423312.req, 1593 bytes, 4 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420201.req, 2253 bytes, 5 tape blocks x /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log/l420204.req, 1517 bytes, 3 tape blocks From the a above output, I can see that the tar command is trying to copy the /u01/oracle/ERPDEV/appldev//inst/apps/DEV_zanerpuat/logs/appl/conc/log. When i checked my destination location, I didnt see anything there. cd /u02/oracle/ERPTEST/appltest $ ls $ Please help me on this. Thanks and Regards, Daniesh |
All times are GMT -5. The time now is 09:05 PM. |