dump2tar(1)
π dump2tar(1) β Gather file contents and command output into a tar archive π
okay bestie, this is the dump2tar(1) manual page, and it's lowkey iconic: we're shoving file contents and command output into a tar archive like it's no big deal. π
β¨
πΈ NAME πΈ
dump2tar β Gather file contents and command output into a tar archive π
π¦ SYNOPSIS π¦
dump2tar [OPTIONS] SPECS
β¨ DESCRIPTION β¨
dump2tar creates a tar archive from the contents of any files, including files of unknown size. fr fr, any files. π
Examples for files of unknown size are:
- Named pipes (FIFOs)
- Particular Linux kernel
debugfsorsysfsfiles - Character or block devices
When adding such a file, dump2tar first reads all available data until an end-of-file indication is found. From this data, it then creates a regular file entry in the resulting tar archive. By default, symbolic links and directories are preserved in the archive in their original form. π«Ά
dump2tar can also:
- Add files under a different name
- Run arbitrary commands and add the resulting command output as a regular file
ποΈ FILE SPECIFICATIONS ποΈ
This section describes the format of the SPECS argument mentioned in the command synopsis. Use the following command line syntax to identify data sources and to specify file names within the archive:
PATHβ Adds the contents of the file system subtree at file system locationPATH(with possible exceptions described by options) in the archive under the same file name as on the file system.FILENAME:=PATHβ Adds the contents of the file at file system locationPATHin the archive under the name specified byFILENAME.FILENAME|=CMDLINEβ Runs the commandCMDLINEand captures both the resulting standard output and standard error streams. Adds the collected output as a regular file namedFILENAMEin the resulting archive. You can also include the resulting program exit code by using option--add-cmd-status.
You can also specify --. All specifications that follow are interpreted as simple file names. This is useful for archiving files that contain := or |=. π
π¦ OUTPUT OPTIONS π¦
-o TARFILE,--output-file TARFILEβ Writes the resulting tar archive toTARFILE. An existing file at the specified file system location is overwritten. If this option is omitted or if-is specified forTARFILE, the archive is written to the standard output stream.-z,--gzipβ Compresses the resulting tar archive usinggzip.-m VALUE,--max-size VALUEβ Sets an upper size limit, in bytes, for the resulting archive. If this limit is exceeded after adding a file, no further files are added.-t VALUE,--timeout VALUEβ Sets an upper time limit, in seconds, for the archiving process. If this limit is exceeded while adding a file, that file is truncated and no further files are added.--no-eofβ Does not write an end-of-file marker. Use this option if you want to create an archive that can be extended by appending additional tar archive data.
β οΈ Note: Do not use this option for the final data to be added. A valid tar archive requires a trailing end-of-file marker.
--appendβ Appends data to the end of the archive. Use this option to incrementally build a tar file by repeatedly callingdump2tar. You must specify the--no-eofoption for each but the final call ofdump2tar.--add-cmd-statusβ Adds a separate file namedFILENAME.cmdstatusfor each command output added through theFILENAME|=CMDLINEnotation (see FILE SPECIFICATIONS). This file contains information about the exit status of the process that executed the command:EXITSTATUS=VALUEβ UnlessVALUEis-1, the process ended normally with the specified exit value.TERMSIG=VALUEβ UnlessVALUEis-1, the process was stopped by a signal of the specified number.WAITPID_ERRNO=VALUEβ UnlessVALUEis-1, an attempt to obtain the status of the process failed with the specified error.
π₯ INPUT OPTIONS π₯
-F FILENAME,--files-from FILENAMEβ Reads input data specifications (see FILE SPECIFICATIONS) fromFILENAME, one specification per line. Each line contains either a file name or aFILENAME:=PATHorFILENAME|=CMDLINEspecification. Empty lines are ignored. A line can also consist of only--. All lines following this specification are interpreted as simple file names. This is useful for archiving files that contain:=or|=.-i,--ignore-failed-readβ Continues after read errors. By default,dump2tarstops processing after encountering errors while reading an input file. With this option,dump2tarprints a warning message and adds an empty entry for the erroneous file in the archive.-b VALUE,--buffer-size VALUEβ Reads data from input files in chunks ofVALUEbytes. Large values can accelerate the archiving process for large files at the cost of increased memory usage. The default value is1048576.-T VALUE,--file-timeout VALUEβ Sets an upper time limit, in seconds, for reading an input file.dump2tarstops processing a file when the time limit is exceeded. Archive entries for such files are truncated to the amount of data that is collected by the time the limit is reached.-M N,--file-max-size Nβ Sets an upper size limit, in bytes, for an input file.dump2tarstops processing a file when the size limit is exceeded. Archive entries for such files are truncated to the specified size.-j N,--jobs Nβ By default,dump2tarprocesses one file at a time. With this option,dump2tarprocessesNfiles in parallel. Parallel processing can accelerate the archiving process, especially if input files are located on slow devices, or when output from multiple commands is added to the archive.
π Note: Use tar option--delay-directory-restorewhen extracting files from an archive created with--jobsto prevent conflicts with directory permissions and modification times.
-J N,--jobs-per-cpu Nβ ProcessesNfiles for each online CPU in parallel. Parallel processing can accelerate the archiving process, especially if input files are located on slow devices, or when output from multiple commands is added to the archive.
π Note: Use tar option--delay-directory-restorewhen extracting files from an archive created with--jobs-per-cputo prevent conflicts with directory permissions and modification times.
-x PATTERN,--exclude PATTERNβ Does not add files to the archive if their file names matchPATTERN.PATTERNis an expression that uses the shell wildcards.-X FILENAME,--exclude-from FILENAMEβ Does not add files to the archive if their names match at least one of the patterns listed in the pattern file with nameFILENAME. In the pattern file, each line specifies an expression that uses the shell wildcards.--exclude-type TYPEβ Does not add files to the archive if they match at least one of the file types specified withTYPE.TYPEuses one or more of the characters"fdcbpls", where:fβ regular filesdβ directoriescβ character devicesbβ block devicespβ named pipes (FIFOs)lβ symbolic linkssβ sockets
--dereferenceβ Adds the content of link targets instead of symbolic links.--no-recursionβ Does not add files from sub-directories. By default,dump2taradds archive entries for specified directories, and for the files within these directories. With this option, a specified directory results in a single entry for the directory. Any contained files to be included must be specified explicitly.
π MISC OPTIONS π
-h,--helpβ Prints an overview of available options, then exits.-V,--verboseβ Prints additional informational output.-q,--quietβ Suppresses printing of informational output.
π EXAMPLES π
# dump2tar a b -o archive.tar
Creates a tar archive named archive.tar containing files a and b. β¨
# dump2tar /proc -o procdump.tar.gz -z -i -T 1 -M 1048576
Creates a gzip compressed tar archive named procdump.tar.gz that contains all procfs files. Unreadable files are ignored. Files are truncated when the first of the two limiting conditions is reached, either 1048576 bytes of content or the reading time of 1 second. π₯
# dump2tar '|=dmesg' '|=lspci' -o data.tar
Creates a tar archive named data.tar containing the output of the dmesg and lspci commands. π»
# dump2tar /sys/kernel/debug/ -x '*/tracing/*' -o debug.tar -i
Creates a tar archive named debug.tar containing the contents of directory /sys/kernel/debug/ while excluding any file that is located in a sub-directory named tracing. π¦
πͺ EXIT CODES πͺ
0β The program finished successfully1β A run-time error occurred2β The specified command was not valid
π SEE ALSO π
dump2tar(1), tar(1) π
okay bestie, that's the whole dump2tar(1) page, dated 2016-09-02 β go archive something iconic. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: s390-tools 2.44.1-160000.1.1 Β· MIT
- Copyright 2017 IBM Corp
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms