I'm trying to combine two options for creating a tar archive, but they don't work well together. I don't know what's the problem.
tar -C /var/www/website html -cvzf html.tgz -T /tmp/htmllist.txt
If I use only the -C option it creates a tar archive with only a relative path "./html/", but ALL the files inside that folder. I don't want this.
Then if I use only the -T option it creates a tar archive with only the required files, but the path is absolute "/var/www/website/html/whatever.html". I don't want this either.
I want a combination of the two, but somehow it doesn't work.
The folder structure is:
- Lots of .html files
The /tmp/htmllist.txt folder contains lines like:
And so on.
How do I solve this problem?