Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to set an arbitrary path within a tar archive to place files which may not exist on your original filesystem? This differs from the -C switch in that I may want to take a back up of /etc/, but place it in the archive as /configurations/etc/.

share|improve this question
1  
IIRC the -s option does that, but don't have time to write up a whole answer right now. –  Chris S Sep 12 '11 at 22:30

1 Answer 1

up vote 2 down vote accepted

In GNU tar, --transform (--xform) is the option to make file name transformations. Documentation and examples can be found here

share|improve this answer
    
I would have seen this had I read man tar on my system rather than on linux.die.net!! Thanks for the answer, regex is even better than I'd hoped for. –  andyortlieb Sep 13 '11 at 18:53
1  
@andyorlieb, thanks for the input on "--xform" not working on your system, but please do not change the content of people's answers unless you have a definitive reference to back it up. Thank you. –  Chris S Sep 13 '11 at 20:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.