S
S
Sergey2017-02-02 13:40:48
linux
Sergey, 2017-02-02 13:40:48

tar. How can I add a file to an already existing etc.tar archive to a specific folder in that archive?

You need to add the ifcfg-lo file to the etc.tar archive to the /etc/sysconfig/network-scripts/ directory in this archive... I've been suffering for the third hour now... I'm trying to modify the path using --transform, but nothing happens

tar af etc.tar ifcfg-lo --transform='s:^:etc/sysconfig/network-scripts/:'

This is how strange is added ... separately from everything ... tell me please2c83eac12c694d88a84643937dabd24c.PNG

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2017-02-02
@workout97

tar fr etc.tar * --transform='s:^:etc/sysconfig/network-scripts/:'

A
ATauenis, 2017-02-02
@ATauenis

mv etc.tar ../other/dir/ ; tar fr ../other/dir/etc.tar * --transform='s:^:etc/sysconfig/network-scripts/:' ; mv ../other/dir/etc.tar .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question