Backup the entire content without directory
Closed this issue · 4 comments
What are you trying to do?
Currently, I have 2 folders and several files inside the /backup
directory. How can I archive them, so that we don't have /backup
directory inside the archive, but only it's content?
That's currently not supported (not sure if a "rootless" tar archive is even expected), but you can definitely strip the /backup
directory at untar time by using --strip-components
: https://superuser.com/a/899688
Yeah, I know about --strip-components
, just don't wanna keep the root folder in the backups. tar
supports having multiple directories in root, you may specify them when you do create archive: tar -zcvf a.tgz a b c
Is there anything you cannot do because of the root folder? Or is this merely an "aesthetic" preference?
Well, it just adds extra work for backup users, who want to unpack. It means they will be required to update their scripts since previously we did not have an extra root folder in backups.