[SOLVED] Is this possible? Create a tar.gz of a directory and place it in a different directory without all of the directories nested in the path?
by wh33t from LinuxQuestions.org on (#5RAR0)
Lemme explain. I wanna back up webroot located at /var/www/html/webroot by creating a file called webroot.tar.gz but I wanna place it in /var/www/html/archive, in the archive itself I only want to see the webroot directory, and it's files contained with in. I do not want to open the archive and see var, then www, then html, then webroot. I have a feeling I need to be using the -C option but I can't for the life of me figure out how.
Any tips? I am hoping to do this in a single command.
Update: I figured it out! Thanks for reading anyhow.
Code:tar -czf /var/www/html/archive/webroot.tar.gz -C /var/www/html/ webroot
Any tips? I am hoping to do this in a single command.
Update: I figured it out! Thanks for reading anyhow.
Code:tar -czf /var/www/html/archive/webroot.tar.gz -C /var/www/html/ webroot