Tag Info

New answers tagged

1

The docker container which you're using does not provide a utility for tar. I tested this using the following; sudo docker run -i -t rhel6 /bin/bash This created an interactive shell for me within Docker using the rhel6 image, from there I can then check in an interactive manner the error which you're seeing; bash-4.1# find / -name tar bash-4.1# yum list ...


10

I think this should do it: tar -xzf file.tar.gz -C ~/locationX folder1 -C ~/locationY folder2 The -C option means to change to the specified directory before doing the extraction. Specifying filename arguments after the tarfile name restricts the extraction to just those files or directories. And you can repeat this -Changing directories as you do. Note ...


0

Could it be the blocksize of the disks? Check it on each disk with: blockdev --getbsz /dev/<id of the disk> For example: blockdev --getbsz /dev/sdb1


0

Assuming the rest of your command works correctly, you can just replace the last part xargs tar -xvpf with (cd /certain/directory; xargs tar -xvpf) and the tar command will be executed from this directory. This is a common useful 'trick' for executing commands relative to another directory. Note this only works in this because your tar file name (in ...


0

Consider using Backup Exec for Linux. Not free, but that'd cover your management needs. What are the "Windows people" doing for a backup solution? Are you allowed to purchase the same kind of solution for the Linux side? BTW, logrotate can be used to rotate out your backup copies. There are a number of great discussions in stackexchange regarding the use ...


1

If data.txt is the only file in the tar archive, you could append directly, simply by not using tar at all: $ echo Hello | bzip2 > data.txt.bz2 $ echo Stack | bzip2 >> data.txt.bz2 $ echo Exchange | bzip2 >> data.txt.bz2 $ bunzip2 < data.txt.bz2 Hello Stack Exchange


1

I can think only of the Archivemount utility to do that. 1) Install archivemount (if its not already available on your machine). Its available in the EPEL repo. 2) Use the archivemount command to mount your tar file on any of the directories in your machine. archivemount xyz.bzip2 /path/to/a/directory/ Once mounted, you will be able to browse through ...


0

You can append files to a non-compressed tar archive with the --append switch, for example: $ tar --append --file=tarfile.tar data.txt Beware the consequences of adding multiple files of the same name to an existing archive : http://www.gnu.org/software/tar/manual/html_node/append.html You cannot, as far as I am aware, append or update files in a ...


0

Here is a piece of code to replace the user/group with ids on the fly: tar ca --owner="$(id -u ***otherowner***)" --group="$(id -g ***othergroup***)" mydata.tgz mydata


1

You could hardlink them on a different directory and than tar # find all files in directory named directory find directory -type f | \ while read f; do f2=`echo "$f"|sed -e 's/\//:/g'` # replace / with : ln "$f" "directory2/$f2" # create hardlinks in directory2/ done This will create the following links directory/file1 => ...


0

You can try this. Find all *tar files in current folder and copy to MainDirectory folder or wherever do you want. find . -iname "*tar*" -exec cp {} ~/MainDirectory/ \;


0

I guess the way to do this is to create a new directory just as backup source and fill it with hardlinks. I hope the whole directory tree you want to backup is on the same volume. > pwd /path/to/documents > cd /path/to/ > mkdir tar-documents > mkdir tar-documents/documents > ln /path/to/documents/file1 > ln /path/to/documents/file2 > ln ...


0

XZ_OPT=-9e tar cJf tarfile.tar.xz directory is even better than XZ_OPT=-9 tar cJf tarfile.tar.xz directory


0

If you know which processes are writing to files in that directory, you can freeze them using kill -SIGSTOP <pid>, do your backup then resume the processes with kill -SIGCONT <pid>.


0

To my knowledge, atomicity of such a transaction cannot be guaranteed by ext4 in itself without cooperation from the application that is accessing the data concurrently. Using some snapshot mechanism in an underlying device mapper won't work either, since you'd basically need to unmount the filesystem (or at least remount-ro) in order to obtain a consistent ...


1

You can decouple the "package all files together" part from "compress as much as possible" and play around with different compression options to see which has an acceptable trade off between time/memory/size: tar cvf - ./APP_sys | gzip -9 > APP_sys.tar.gz Or tar cvf - ./APP_sys | bzip2 --best > APP_sys.tar.gz Or tar cvf - ./APP_sys | xz -9e > ...


0

The tar command will store one full path for each file. Which can represent a great volume if the files are numerous and the paths are long. You should try commands that manage a file index like p7zip .


0

xz has the best rate of compression i have seen and is installed by default on most solutions. tar -Jcvf APP_sys.tar.xz /usr/cti/APP_sys I hope this helps


2

With GNU tar, you can use that command: tar --transform="s|/|/abc/|" -Pcf bar.tar / Otherwise, here is a portable way to do it, i.e. one that doesn't rely on a GNU or other specific tar extension but is based on a POSIX tool that should be available on any Unix compliant machine: pax -w -s '/\//\/abc\//' -f foo.tar /


0

The closest I can find is the --transform option. I don't know for sure, but I'm guessing this is a GNU only flag: --transform, --xform EXPRESSION use sed replace EXPRESSION to transform file names Using that, you can pass a sed substitution command and change the / to /abc: tar cf root.tgz --transform 's/^\//\/abc/' / This will still print / ...


0

You're interested on PAR2, which uses Reed-Solomon error correction. parchive is the ECC file format specification, for Linux you will want PyPar or par2tbb, and on Windows you use a GUI called QuickPar.


2

$ eval echo -e "n\ $d/$prf.00{2..$last}.tar\\\n" n someprefix.002.tar n someprefix.003.tar n someprefix.004.tar How did that whitespace get in there? The answer in a nutshell: this is analogous to the output you'd get if you echoed a line using filename expansion on a bunch of files whose names end with newline. As described in brace expansion: ...


1

You can use xargs to feed the output of a command as arguments to another: find . -iname '*.txt' -print0 | xargs -0 tar zcvf the_tarball.tar.gz Note here the -print0 from find and -0 from xargs work in conjunction to delimit file names correctly (so that names with spaces and such aren't a problem).



Top 50 recent answers are included