Changing absolute path for tar command in Solaris OS
When we use tar command in Linux, The / is trimmed, So when we restore from tar file , It will extract the files to directory we wish to to extract without overwriting.
In Solaris, tar command contains the absolute path, When we try to restore , It will restore to the absolute path as source.
This is some times very dangarous where it can overrite the source files or when you need to restore it in other locations, You need to have same file system as source.
To avoid this , Use the below.
$ tar tvf backup_apps.tar
-rwxr-xr-x 205/100 34260 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/Notepad/Notepad.jar
-rwxr-xr-x 205/100 339 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/Notepad/README.txt
drwxrwx--- 205/100 0 Jan 2 21:17 2007 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/
-rwxr-xr-x 205/100 22353 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/TableExample.jar
drwxrwx--- 205/100 0 Jan 2 21:17 2007 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/
-rwxr-xr-x 205/100 8613 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample.java
-rwxr-xr-x 205/100 8790 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/JDBCAdapter.java
-rwxr-xr-x 205/100 3293 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample2.java
-rwxr-xr-x 205/100 5708 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample3.java
-rwxr-xr-x 205/100 9339 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/OldJTable.java
-- If you extract using tar -xvf backup_apps.tar command, It will restore to original directory structure if available or errors out if not avaibale.
The work around for this problem is , Use command pax to extract the files in solaris instead of tar -xvf command.
pax -r -s '=^/tstdp1/prg/oracle/R12=/usr/R12=' < backup_apps.tar
Now it will extract to /usr/R12 folder.
$ cd /usr/R12
$ls -ltr
drwxr-xr-x 4 oracle oinstall 4 Jan 5 15:01 apps
When we use tar command in Linux, The / is trimmed, So when we restore from tar file , It will extract the files to directory we wish to to extract without overwriting.
In Solaris, tar command contains the absolute path, When we try to restore , It will restore to the absolute path as source.
This is some times very dangarous where it can overrite the source files or when you need to restore it in other locations, You need to have same file system as source.
To avoid this , Use the below.
$ tar tvf backup_apps.tar
-rwxr-xr-x 205/100 34260 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/Notepad/Notepad.jar
-rwxr-xr-x 205/100 339 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/Notepad/README.txt
drwxrwx--- 205/100 0 Jan 2 21:17 2007 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/
-rwxr-xr-x 205/100 22353 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/TableExample.jar
drwxrwx--- 205/100 0 Jan 2 21:17 2007 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/
-rwxr-xr-x 205/100 8613 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample.java
-rwxr-xr-x 205/100 8790 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/JDBCAdapter.java
-rwxr-xr-x 205/100 3293 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample2.java
-rwxr-xr-x 205/100 5708 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/TableExample3.java
-rwxr-xr-x 205/100 9339 Jan 18 11:14 2006 /tstdp1/prg/oracle/R12/apps/tech_st/10.1.3/jdk/demo/plugin/jfc/TableExample/src/OldJTable.java
-- If you extract using tar -xvf backup_apps.tar command, It will restore to original directory structure if available or errors out if not avaibale.
The work around for this problem is , Use command pax to extract the files in solaris instead of tar -xvf command.
pax -r -s '=^/tstdp1/prg/oracle/R12=/usr/R12=' < backup_apps.tar
Now it will extract to /usr/R12 folder.
$ cd /usr/R12
$ls -ltr
drwxr-xr-x 4 oracle oinstall 4 Jan 5 15:01 apps
new horizon security services richmond vaI would like to thank you for your nicely written post, its very informative and your writing style encouraged me to read it till end. Thanks
ReplyDeleteIEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.
DeleteIEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.
corporate training in chennai corporate training in chennai
corporate training companies in india corporate training companies in india
corporate training companies in chennai corporate training companies in chennai
I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai
Car Accident Lawyer Rockledge Sinclair Law - Leading Florida Law Firm Attorney Brad Sinclair Represents Personal Injury, Car Accident, Motorcycle Accident Victims in Melbourne.
ReplyDeleteOracle fusion HCM Training from ERPTREE gives you the best results to learn your dream course and maintains
ReplyDeletesufficient knowledge on oracle. It provides training by self-paced videos which are very helpful for
the users to watch at any time according to their schedule. It is globally accepted and having many users undergoing training every day.
Oracle fusion HCM Online Training
Oracle Fusion HCM Training
screwtape letters study guide Really Good blog post.provided a helpful information.I hope that you will post more updates like this.
ReplyDeleteThanks for sharing great information, Hope you will share many more articles so that it will be helpful for many of us.
ReplyDeleteOracle Fusion Financials Online Training
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.
ReplyDeleteOracle Fusion HCM Online Training
Astonishing web diary I visit this blog it's incredibly magnificent. Strangely, in this blog content made doubtlessly and sensible. The substance of information is instructive.
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
An astounding web diary I visit this blog, it's inconceivably magnificent. Strangely, in this current blog's substance made point of fact and sensible. The substance of information is instructive.
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
oracle Fusion Technical online training
A bewildering web journal I visit this blog, it's unfathomably heavenly. Oddly, in this present blog's substance made purpose of actuality and reasonable. The substance of data is informative
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
An overwhelming web journal I visit this blog, it's unfathomably amazing. Unusually, in this present blog's substance made inspiration driving truth and reasonable. The substance of data is enlightening
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
ReplyDeletelaptop table
shoe storage nz
outdoor furniture covers nz
We find lots of learning after reading this very useful article . cara menggugurkan hamil
ReplyDeleteNice post……. your article is really informative and helpful for me and other bloggers too
ReplyDeleteBig Data and Hadoop Online Training
Big Data Hadoop Training
Hyderabad
Thank you for sharing such a nice and interesting blog with us.
ReplyDeleteSpark and Scala Online Training
Spark Scala Training
Hyderabad
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteThanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!
internship in chennai
internship in chennai for cse
internship for mba in chennai
internship in chennai for hr
internship in chennai for mba
companies for internship in chennai
internship in chennai for ece
paid internship in chennai
internship in chennai for biotechnology
internship in chennai for b.com students