Hot answers tagged

6

The problem is in how tar stores files. So, for example $ echo hello > a $ ln a b $ tar cf foo.tar a b $ tar tf foo.tar a b The problem happens when you try to extract just one file $ mkdir Y $ cd Y $ tar xvf ../foo.tar b b tar: b: Cannot hard link to `a': No such file or directory tar: Exiting with failure status due to previous errors What you ...


4

Don't rely on wildcard matching / shell globbing but instead use the find command to find and list the files you want and send that list to tar to be archived: find /A/ -type f -print0 -name \*.log | tar -cvf /path/to/file.tar --null -T -


4

It's important to understand there's a trade-off here. tar means tape archiver. On a tape, you do mostly sequential reading and writing. Tapes are rarely used nowadays, but tar is still used for its ability to read and write its data as a stream. You can do: tar cf - files | gzip | ssh host 'cd dest && gunzip | tar xf -' You can't do that with ...


4

tar will unpack its archive in the order that it was created. ( echo foo; echo foo/a; echo b; echo foo/c ) | tar --files-from=- --no-recursion -cvf /tmp/tar.tar and tar tvf /tmp/tar.tar drwxr-xr-x roaima/roaima 0 2016-06-27 20:20 foo/ -rw-r--r-- roaima/roaima 0 2016-06-27 20:20 foo/a -rw-r--r-- roaima/roaima 0 2016-06-27 20:13 b -rw-r--r-- roaima/roaima ...


3

First of all, the the overall power consumption will be likely the same or more if you artificially slow down the backup process. Simply because the total number of operations is the same and if the process takes longer, the cpu consumes less peak power but over a longer time. For example, if the process runs for 10 s at peak power of 200W this will consume ...


2

One approach would be to use parallel compression in order to use all of the cores of your system and therefore reduce the compression time. It won't reduce the load on your system, but it will be loaded for a shortest amount of time ! You can find how to do it in this Q/A for example : utilizing-multi-core-for-targzip-bzip-compression-decompression For ...


1

The command tar czf /media/masi/ntfsDisc/backup_home.tar.gz $HOME/ is the same as this: tar cf - $HOME/ | gzip > /media/masi/ntfsDisc/backup_home.tar.gz When you ran top, it showed the gzip was using up around 100% of one cpu thread. The NTFS FUSE software is using up a nonzero amount of CPU, too, but essentially you're CPU-bound because of that ...


1

The entry --exclude=/var/backups should read --exclude=var/backups to match the pattern expected by tar


1



Only top voted, non community-wiki answers of a minimum length are eligible