I want to create a tar file of a list of files. The list of files should be read from a separate file named input.txt.
This is the content of the input.txt -
- /var/opt/SM/logs/rq/log.txt
- /var/opt/DC/mq/mqlog.txt
- /var/opt/config.cg
The compressed file should have a directory structure -
- /logs/SM/logs/rq/log.txt
- /logs/DC/mq/mqlog.txt
- /logs/config.cg
/var/opt/ if exists in input file path, it should be replaced with /logs.
This is the expected output when I extract the tar file in say root directory.
- root/logs/SM/logs/rq/log.txt
- root/logs/DC/mq/mqlog.txt
- root/logs/config.cg