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