Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 31179  / 2 Years ago, tue, october 25, 2022, 8:23:45

Is there a way to tar extract without clobbering?



I am installing 12.04 and want to restore my data from 10.10. Anything 12.04 specific I would like to keep, that is I do not want the tar'd 10.10 version to be extracted. If I do a general restore such files as .bashrc will be clobbered. Is there a way to avoid this?



Edit: I would note that a booted 12.04 ISO disk image allows an upgrade from 10.10 (or whatever) and it offers to keep old data. I tried this but it complained some applications might be left broken after the upgrade. I decided to just reboot and do a clean install.


More From » tar

 Answers
0

I have difficulty understanding what you want but if you made a tar file of your whole system I believe you made a very large tar file that has not a real purpose unless you completely restore the tar file. If you wanted to save your own documents you should have made a backup of those documents and nothing else.



After saying that tar has several nifty options ...



--keep-old-files


This will not overwrite existing files.



--keep-newer-files 


This will keep all files that have a newer timestamp as is.



--no-overwrite-dir


This will leave the metadata of an existing directory as is.



A manual for tar can be found here.



But I would advice extracting the tar file on another medium and manually restore those files. It is the safest method.


[#38903] Thursday, October 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ofunn

Total Points: 164
Total Questions: 116
Total Answers: 116

Location: Liberia
Member since Fri, Oct 22, 2021
3 Years ago
ofunn questions
;