tar files from multiple locations into a tarball preserving location paths
i reckon i could do this with a whole load of &&s and tar appends, but i'd much rather just paste in a list of file paths to a single command. ... i suppose i could achieve similar with a complex "mv" addition to the command, but then i'd lose the very important original locations.
attempts have either lead to multiple files (like when i tried just lzma alone) or error messages when tarring. what i was trying on my mock-up test files: Code:
g@usbgeneray:~$ lzma -zk9 /home/g/testzone/marglepeeps /home/g/testzone/om /home/g/testzone/mop.lzma (and yeah, i did search for it for a while, but failed.) so in my test example, i want to end up with the files "marglepeeps" and "om" in the same "mop.tar.lzma" file, even if i were to have one of marglepeeps or om, start from a distant location. when i get this, i hope to include a list of config files into such a command, so i can transfer/backup these configs for use on other machines (and my archiso overlay folder) after a simple extraction. |
If you want to create a tar the name of the tar comes before
the directories you want to tar up ... Code:
tar -cvzf /home/g/testzone/mop.tar.gz /home/g/testzone/marglepeeps /home/g/testzone/om Cheers, Tink |
Also, assuming you have the correct compression application installed, the following works well:
Code:
tar acf /home/g/testzone/mop.tar.XXX /home/g/testzone/marglepeeps /home/g/testzone/om |
All times are GMT -5. The time now is 02:22 PM. |