STAR(1)
โจ STAR(1) โ Schilyยดs USER COMMANDS โจ
๐ธ NAME ๐ธ
star โ unique standard tape archiver. periodt. ๐
๐ SYNOPSIS ๐
star command [options] [-find] file1 ... filen [find_expr]
ustar command [options] [-find] file1 ... filen [find_expr]
star command list=name [options] -find [find_expr]
tar command [options] file1 ... filen
star -copy [options] [-find] file1 ... [f_expr] directory
star -copy [options] -C from_directory . to_directory
star cli=name ...
๐ DESCRIPTION ๐
okay so bestie, star is a very fast tar(1)-like tape archiver with improved functionality. It supports unlimited path name lengths (up to 8 GB) in all cases that use suitable archive types. no cap. ๐
Star archives and extracts multiple files to and from a single file called a tarfile. A tarfile is usually a magnetic tape, but it can be any file. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory.
Star's actions are controlled by the mandatory command flags from the list below. The way star acts may be modified by additional options.
โ ๏ธ Note that unpacking tar archives may be a security risk because star may overwrite existing files. See SECURITY NOTES for more information.
If the first argument is in the form cli=name, the command line interface is selected to match name. See section CLI SELECTION below.
โจ FEATURES โจ
- POSIX.1-2001 extended tar headers: Star includes the first free implementation of POSIX.1-2001 extended tar headers. The POSIX.1-2001 extended tar headers define a new standard way for going beyond the limitations of the historic tar format. They allow (among others) to archive all UNIX time stamps in sub-second resolution, files of arbitrary size and filenames without length limitation using UNICODE UTF-8 coding for best exchange compatibility. ๐
- fifo by default: Star by default uses a fifo to optimize data flow from/to tape. This results in a normally streaming tape during the whole backup. See
-fifoandfs=option to get information on how to find the best fifo size. - pattern matcher: Star includes a pattern matcher to control the list of files to be processed. This gives a convenient interface for archiving and restoring complex lists of files. In conjunction with the
-wflag it is easy to merge a tar archive into an existing file tree. See also-Uoption. In create mode use thepat=option to specify either select or exclude patterns (depending on the-Vflag). In extract or list mode all file type arguments are interpreted as select patterns while the patterns specified with thepat=option may be used as select or exclude patterns (depending on the-Vflag). Have a look at the description of the-Coption to learn how to fetch files from a list of directories (in create mode) or to distribute files to a list of directories (in extract mode). A substitute option allowsed(1)like pattern substitution in file names. - incremental backup and restore: Star includes support for incremental backup and restore similar to the BSD commands
dump(1)andrestore(1)that are known asufsdump(1)andufsrestore(1)on Solaris. - find-like function: Star includes an enhanced function that is similar to the
find(1)command (seesfind(1)). This function is implemented inlibfind. It allows one to use find expressions, even in extract or list mode, directly on the content on an archive. The extensions tofind(1)allow one to modify the file metadata. - diff command: Star includes a sophisticated diff command that is able to compare file content and meta data. Several diff options allow user tailorable functionality. Star won't show you differences you are not interested in. Check the
diffopts=option for more details. - filename length: Star has no limitation on filename length. Pathnames and linknames up to
PATH_MAX(typically 1024 bytes) may be archived by most tar implementrations. Star allows one to archive path names up to 8 GB on modern platforms. - all 3 times: Star deals with all 3 times, available for files on UNIX systems if the archive format is either chosen from the star specific formats or is a format that uses POSIX.1-2001 extended headers. This is either done in second resolution by using a star specific POSIX.1-1988 compatible extension or in sub second resolution by using POSIX.1-2001 extended headers. Star is able to store and restore all 3 times (
mtime,atimeand evenctime). On Solaris 2.x systems โ if run as root โ, star is able to do backups without changing any of the 3 the times. - POSIX compliance: If used with the
H=ustaroption, or if called asustarortarwhile theH=headertypeoption is not used, star is 100% POSIX compliant. - default format: Star's default format (if called as
star) isxstarand is as posix compliant as possible. Enhancements to the standard that prevent correct extraction of single files when using a different tar implementation that is only POSIX.1-1988 compliant may occur, but they only affect single files with a pathname that is longer than100+130chars or when archiving sparse files with the-sparseoption in effect. All other files will extract correctly. See the description for theH=headertypeoption below for more information on archive formats and possible archive interchange problems. - repair corrupted filesystems: Star makes it easy to repair corrupted filesystems. After a
fsck -yhas been run on the filesystem, star is able to restore only the missing files automatically. Use thenstar -diffto check for differences (see EXAMPLES for more information). - archive type recognition: Star automatically recognizes the type of the archive. Star therefore is able to handle features and properties of different archive types in their native mode, if it knows about the peculiarities of the archive type. See the
H=headertypeoption for more details. To be able to do this, star adds hidden fingerprints to the archive header that allows one to recognise all star specific archive formats. The GNU tar format is recognised by the way it deviates from the standard. - byte swapping: Star automatically recognizes and handles byte swapped archives. There is no option to manually control byte swapping.
- ACLs: Star is able to archive and restore Access Control Lists for files using POSIX.1-2001 extended headers.
๐ CLI SELECTION ๐
If the first argument is in the form cli=name, the command line interface is selected to match one of the supported CLI variants. The following interfaces are supported:
starโ The star interface selects the command line interface described in this manual page. ๐suntarโ The suntar interface selects the command line interface of the classical UNIX tar command as described insuntar(1).tarโ The classical tar interface selects the command line interface of the classical UNIX tar command. This is currently an alias tosuntarand implements extensions introduced by the tar command found on Solaris.gnutarโ The gnutar interface selects the command line interface of the GNU tar command as described ingnutar(1). Star however does not implement the deviations from the standard behavior, that are caused by the GNU option parser that is used by the originalgtar(1)command.paxโ The pax interface selects the command line interface of the POSIX pax command as described inspax(1).cpioโ The cpio interface selects the command line interface of the classical UNIX cpio command as described inscpio(1).
๐ COMMAND ๐
Okay bestie, so in native mode, star plays nice with the command line syntax of a typical POSIX command โ which means it expects commands and options to start with a single dash (-). And the way this works is: commands and options can be specified separately, and all the boolean or increment type options can be specified either separately or combined. Mix and match, she's flexible ๐
And for compatibility with GNU programs, long options may alternatively start with a double dash.
Now, in compatibility mode to POSIX tar, star expects commands and options to appear as one single string that does not start with a dash. And in POSIX tar compatibility mode, additional non-POSIX options may be specified โ but they must appear after the POSIX options and their args, and they need to start with a dash. Periodt.
-cโ Create a new tarfile and write named files into it. Writing starts at the beginning of tarfile. Peep the-voption if you wanna know how to crank up verbosity while the archive is being written ๐
The option -c may be used together with -diff and -t. In that case, the whole command line has to be similar to the command line for the -copy mode.
-copyโ Copy named files to the target directory, which is the last file type argument. The target directory must exist. And no, the shorthand-cxinstead of-copyis not allowed, because that could just be a typo, and we don't do typos-as-features around here ๐ โโ๏ธ
If the option -diff has been specified in addition, star performs a one pass directory tree compare instead of copying files. The shorthand -c -diff instead of -copy -diff is also allowed.
On operating systems with slow file I/O (such as Linux with any filesystem, or platforms with Copy on Write filesystems like ZFS), it may help to use -no-fsync in addition (see also ENVIRONMENT and FILES) โ but then star is unable to detect all error conditions, so use with care, bestie ๐ญ
If the option -t has been specified in addition, the last file type argument is not a target directory, and star is performing a one pass listing instead of copying files. Which honestly makes sense, because the listing from star may be better readable than the output from ls -lR. The shorthand -c -t or -ct instead of -copy -t is also allowed.
The job is by default done in the best archive mode. This implies that it defaults to H=exustar -dump. When in -copy mode, star forks into two processes and data exchange is done via the shared memory from the FIFO. This gives the best possible performance ๐๏ธ And without FIFO, the -copy mode will not work.
The list= option, patterns and substitutions apply only to the create side of the copy command.
-diffโ Compare the content and the attributes of the files from the archive in tarfile to the filesystem. This may also be used to compare two file trees in the filesystem. If you use a set of diffopts that fits your needs, it will give โ in many cases โ a more readable output thandiff -r. And if you usestar's dump extensions for the tar archive, the-diffoption lets you find even if the directory in the file tree contains more files than the archive. That way it's possible to compare all properties of two file trees in one single run. See diffopts for more details. Adding one or more-voptions increases the verbosity. With-vvand above, the directory content is compared also ifstaris reading a tar archive that has been created in-dumpmode โจ-nโ No extraction. Show whatstarwould do, in case the-xcommand had been specified. A little preview moment ๐-rโ Replace files in a tarfile. The named files are written to the end of tarfile. This implies that later, the appropriate files will be found more than once on the tarfile.-tโ Table of contents. List the contents of the tarfile. If the-vflag is used, the listing is similar to the format ofls -loutput. With this option, the flags-a,-atimeand-ctimehave a different meaning if the archive is instar,xstar,xustar,exustar, orpax/epaxformat. The option-aor-atimelists the access time instead of the modification time, and the option-ctimelists the file creation time instead of the modification time. The option-tpathmay be used in addition to modify the output so it may be used in shell scripts ๐-uโ Update a tarfile. The named files are written to the end of tarfile if they are not already there, or if the files are newer than the files of the same name found in the archive. Heads up tho: the-rand-ucommand only work if the tar archive is a regular file, or if the tar archive is an unblocked tape that may backspace.-xโ Extract the named files from the tarfile. If no filename argument or pattern is specified, the entire content of the tarfile is restored. If the-Uflag is not used,starextracts no file which is older than the corresponding file on disk.
On operating systems with slow file I/O (such as Linux with any filesystem, or platforms with Copy on Write filesystems like ZFS), it may help to use -no-fsync in addition (see also ENVIRONMENT and FILES) โ but then star is unable to detect all error conditions, so use with care ๐ญ
Except for the shorthands documented above, exactly one of the commands above must be specified. No mixing, bestie, she said what she said ๐
And if one or more patterns or substitution commands have been specified, they apply to any of the commands listed above. In copy mode, all patterns and substitute commands apply to the create side.
โจ OPTIONS โจ
-helpโ Print a summary of the most important options forstar(1).-xhelpโ Print a summary of the less important options forstar(1).-/โ Don't strip leading slashes from file names when extracting an archive. Tar archives containing absolute pathnames are usually a bad idea. With other tar implementations, they may possibly never be extracted without clobbering existing files.star, for that reason, by default strips leading slashes from filenames when in extract mode. And since it may be impossible to create an archive where leading slashes have been stripped while retaining correct path names,stardoes not strip leading slashes in create mode.
See SECURITY NOTES for more information ๐จ
-..โ Don't skip files that contain/../in the name. Tar archives containing names with/../could be used to compromise the system. If they are unpacked together with a lot of other files, this would in most cases not even be noticed. For this reason,starby default does not extract files that contain/../in the name, ifstaris not in interactive mode (see-woption).
See SECURITY NOTES for more information ๐จ
-7zโ Run the input or output through ap7zippipe. See section COMPRESSION for details.-0-1-2-3-4-5-6-7โ Select an archive entry from/etc/default/star. The format for the archive entries is the same as the format in/etc/default/tarin Solaris.-aclโ Handle Access Control List (ACL) information in create and extract mode. If-aclhas been specified,staris in create mode and the header type isexustar,starwill add ACL information to the archive using POSIX.1-2001 extended headers. If-aclhas been specified andstaris in extract mode,starwill try to restore ACL information. If there is no ACL information for one or all files in the archive,starwill clear the ACL information for the specific file. Note that if-aclhas not been specified,starwill not handle ACL information at all, and files may inherit ACL information from the parent directories. And if the-acloption has been specified,starassumes that the-poption has been specified too ๐
star currently supports ACLs from the withdrawn POSIX.1e draft and NFSv4 ACLs. To check which ACL flavors are supported on the current platform, call star -version. Whether ACLs from the withdrawn POSIX.1e draft can be converted into NFSv4 ACLs depends on the local ACL support library.
artype=headertypeโ Generate a tape archive inheadertypeformat. If this option is used in extract/list mode, this forcesstarto interpret the headers to be of typeheadertype. And sincestareven in the case of a user selected extract archive format does format checking, it may be that you will not be able to unpack a specific archive with all possible forced archive formats. Selecting the old tar format for extraction will always work though. Valid parameter forheadertypeare:helpโ Print a help message about possible header types.v7tarโ Old UNIX V7 tar format. This archive format may only store plain files. Pathnames or linknames longer than 99 chars may not be archived.
If the v7tar format has been selected, star will not use enhancements to the historic UNIX V7 tar format. File size is limited to 2 GB - 2 bytes, uid/gid is limited to 262143. Sparse files will be filled up with zeroes.
tarโ Old BSD UNIX tar format. This archive format may only store plain files, directories and symbolic links. Pathnames or linknames longer than 99 chars may not be archived. See also the-doption as a note to some even older tar implementations ๐ต
If the tar format has been selected, star will not use enhancements to the historic tar format. File size is limited to 2 GB - 2 bytes, uid/gid is limited to 262143. Sparse files will be filled up with zeroes.
star
Old star standard format, bestie. This is an upward/downward compatible glow-up of the old (pre Posix) UNIX tar format โ it showed up in 1985 so it is not Posix compliant, we been knew. The star format lets you archive special files (even sockets, yes really ๐) and it records access time and creation time right alongside the modification time. Newer versions of the old star format allow very long filenames (100+155 chars and above), linknames > 100 chars and sparse files (if -sparse is used). It can also copy the device nodes on HP-UX that have 24 bits in the minor device number, which is more than the 21 bits that are possible with the POSIX-1003.1-1988 archive format. Iconic behaviour honestly. โจ
The nonstandard extensions live in the space between the link name and the POSIX file name prefix. And because the star format doesn't use a POSIX magic string, those extensions do not interfere with the POSIX tar formats โ no drama, no collisions. The last 4 bytes of the tar header in the star archive format contain a 'tar\0' signature.
This archive format supports very long path names. ๐ฆ
gnutar
Okay so this one is commonly used, but unfortunately not Posix compliant (although it was designed after 1987, make it make sense ๐ญ). The gnutar format was defined between 1989 and 1994.
Do not use the gnutar archive format unless you want to create an archive for a target system that is known to have only the gnutar program available. The gnutar archive format violates basic rules for any (even the historic) tar archive format, in special when sparse files are archived using the -sparse option. ๐ฉ
GNU tar is not able to extract files with long path names, but under some conditions it creates archives with long path names. We therefore do not limit the creation of gnutar archives with long path names. Not me pointing out the inconsistency... ๐
Using the gnutar archive format causes a high risk that the resulting archive may only be read by gnutar or by star. The implementation of the gnutar archive format within star is not complete, but sufficient for most gnutar archives. See NOTES for more information, bestie.
This archive format supports very long path names. โจ
ustar
IEEE/Posix1003/IEC-9945-1-1988 Standard Data Interchange format, the certified good girl of tar formats ๐
. With this option in effect, star will generate 100% POSIX.1-1988 compliant tar archives. Files with pathnames longer than 100+155 chars or linknames longer than 100 chars may not be archived. If star is called as ustar the default archive format is ustar.
If the ustar format has been selected, star will not use enhancements to the POSIX.1-1988 tar format โ the archive will be strictly conforming. File size is limited to 8 GB, uid/gid/major/minor is limited to 2097151. Sparse files will be filled up with zeroes. No cap, just rules. โจ
pax
The IEEE/Posix1003/IEC-9945-1-1988 successor is the POSIX-1003.1-2001 Standard Data Interchange format. It is called the pax archive format.
If the pax format has been selected, star will not use enhancements to the POSIX.1-2001 tar format โ the archive will be strictly conforming. File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is limited to 2097151. Sparse files will be filled up with zeroes.
This archive format supports very long path names. ๐ฆ
epax
A format similar to the pax format but with forced POSIX.1-2001 extended headers. This enforces stimestamps with nanosecond resolution in the archive. Nanoseconds, bestie, we're talking precision โจ
This archive format supports very long path names. ๐ฆ
xstar
The extended standard tar format has been introduced in 1994. Star uses the xstar format as default archive format. This is an upward/downward compatible enhancement of the IEEE/Posix1003/IEC-9945-1 Standard Data Interchange format. It allows among others very long filenames (100+130 chars and above) and records access time and creation time. Sparse files will be archived correctly (if -sparse is used). The main character of formats fr fr ๐
The access time and creation time are stored at the end of the POSIX file name prefix (this limits the prefix to 130 chars). These extensions do not interfere with the POSIX standard as the fields for mtime and ctime field are always separated from the POSIX file name prefix by a null byte. The last 4 bytes of the tar header contain a 'tar\0' signature.
The xstar format is the default format when star is neither called as tar nor called as ustar.
This archive format supports very long path names. ๐ฆ
xustar
A new format introduced 1998, that omits the 'tar\0' signature at the end of the tar header. It is otherwise identical to the xstar format. As some tar implementations do not follow the POSIX rules and compute the checksum for less than 512 bytes of the tar header, this format may help to avoid problems with these broken tar implementations. ๐ The main other difference to the xstar format is that the xustar format uses POSIX.1-2001 extended headers to overcome limitations of the historic tar format while the xstar format uses proprietary extensions. The xustar format is the default format when star is called as tar.
File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is unlimited. Sparse files will be archived correctly (if -sparse is used).
This archive format supports very long path names. ๐ฆ
exustar
A format similar to the xustar format but with forced POSIX.1-2001 extended headers. If this format is used together with the -acl option, star records Access Control Lists (ACLs) in POSIX.1-2001 extended headers. Bestie, ACLs, the permissions lore ๐
The exustar format allows one to archive all file types but it does not archive more than the POSIX.1-1988 set by default. If the -dump option is used or if star is otherwise on dump mode, star archives all file types and in addition archives more meta data then usual.
File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is unlimited. Sparse files will be archived correctly (if -sparse is used).
This archive format supports very long path names. ๐ฆ
suntar
The extended header format found on Solaris 7/8/9. This format is similar to the pax format but does not handle atime and ctime and in addition uses 'X' as the typeflag for the extended headers instead of the standard 'x'. Different letter, different vibe ๐ธ
File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is unlimited. Sparse files will be filled up with zeroes.
bin
The cpio UNIX V7 binary format. This is a format with big interoperability problems. Try to avoid this format. It is only present to make the scpio command SVr4 compliant. It's giving legacy obligation ๐ญ
cpio
The POSIX.1-1988 cpio format. This format uses octal ascii headers. A similar format is created by calling cpio -o -c on pre SYSVr4 systems and by calling cpio -o -Hodc on SYSVr4 systems. The POSIX.1-1988 cpio format allows a file name length up to 262142 characters and allows one to archive nearly any file type. File size is limited to 8 GB, uid/gid/st_dev is limited to 262143. The way major and minor device numbers are stored inside the st_dev field is implementation dependent. ๐
Even though this archive format is covered by the POSIX.1-1988 standard, it has a lower portability than the ustar format. Try to avoid the cpio archive format.
odc
This archive format is similar to the The POSIX.1-1988 cpio format but the file name length is limited to 255 characters and the socket file type is not allowed. This archive format has been introduced to allow non POSIX cpio implementations such as the cpio program on SYSV to accept the archive. Use this format whenever you are not sure if the target system offers a fully POSIX compliant cpio program. Lowkey the safe pick when you don't know what's on the other side ๐ซถ
Even though this archive format is covered by the POSIX.1-1988 standard, it has a lower portability than the ustar format. Try to avoid the odc archive format.
asc
Tell star to create a cpio archive in the ascii format that is created with cpio -o -c on SYSVr4 systems. It uses extended (32 bit) numbers for uid's, gid's and device numbers but limits the file size to 4 GB - 2 bytes although the format has been specified after the POSIX.1-1988 cpio format. Try to avoid the asc archive format because of its limited portability. That file size cap is not the moment ๐
crcโ okay so this one is like theasccpio format except it ALSO throws in a simple byte-based 32-bit checksum. So the whole "CRC" name that AT&T uses is genuinely misleading โ it's not the CRC you're thinking of, bestie. ๐ Honestly? Try to avoid thecrcarchive format entirely because its portability is... not it. Limited. Very limited.
Every single tar archive format can be swapped around with each other as long as the archive doesn't contain files that can't be archived using the old tar format. And archives in the xstar format? They can be extracted by any 100% POSIX compliant tar implementation if they contain no files with pathnames > 100+130 chars, and if they contain no sparse files that were archived using the -sparse option. Periodt. โจ
-ask_removeโ obsoleted by-ask-remove๐ (she's retired, respect her legacy)-ask-removeโ Ask before removing non-writable files on extraction. By defaultstarwill NOT overwrite files that are read only, no ma'am. But if this option is in effect,starwill ask whether it should remove these files so the extraction can proceed, like this:
remove 'filename' ? Y(es)/N(o) :
-atime,-aโ Reset the access time of files after storing them to the tarfile. On Solaris 2.x (if invoked by root),staruses the_FIOSATIMEioctl to pull this off, which letsstarreset the atime without trashing the ctime. ๐ If you use-atimetogether with the list command,starlists the access time instead of the modification time. (Heads up though โ that only works with thestar,xstar,xustar,exustarformats, and with thepax/epaxformat.) Another way to keep the access time for the files you're about to archive? Readonly mount a UFS snapshot and archive the files from the mount point of that UFS snapshot. ๐ธ-Bโ Forcestarto do multiple reads (if necessary) to fill a block. This option exists sostarcan work across the Ethernet, because pipes and sockets return partial blocks even when more data is coming. And ifstaruses stdin as the archive file, it behaves as if you called it with-Banyway โ which is literally why, in practice, you almost never need this option. ๐ซถb=#โ Set the block size for tape operations. See theblocks=#option. (Same thing, different font.)-block-numberโ Print the archive block number (that's archive offset/ 512) at the beginning of each line when you're in verbose mode. This is how you write backup scripts that archive the offsets for files and then use
mt fsr blockno
to skip straight to the tape block number of interest, fast, if you need to restore a single file. ๐
Careful though bestie โ the numbers printed by-block-numberare based on a block size of512bytes, and the tape block size is usually larger, so the tape block number for themt fsrcommand has to be computed to honor the tape blocking factor. Do the math, don't just vibe it. ๐งฎ
blocks=#,b=#โ Set the blocking factor of the tarfile to#times512bytes (unless you specified a different multiplication factor โ see thebs=option for possible multiplication factors). Changing the blocking factor only makes sense when the archive is on a real tape device or when it's accessed via the remote tape protocol (see thef=option below). The default is a blocking factor of20, i.e.10kBytes. Increasing the blocksize speeds up the backup. ๐ฅ
For portability with very old tar implementations (pre BSD 4.2 or pre AT&T SVR4), blocksize should not be more than 10 kBytes. For POSIX.1-1988 compatibility, blocksize should be no more than 10 kBytes. For POSIX.1-2001 compatibility, blocksize should be no more than 32 kBytes. Most systems also have a hardware limitation on blocksize โ 32 kBytes and 63 kBytes are common limits on many systems. The upper limit in any case is the size of the buffer RAM in the tape drive. Make a test if you want to be sure the target system will handle the intended blocksize โ no guessing, bestie.
If you use star for data exchange via tape, it's a good idea to use a blocksize of 10 kBytes unless you're sure the reading system handles a larger blocksize. If you use star for backup purposes with recent hardware (e.g. DLT tape drives), a blocksize of 256 kBytes gives you sufficient speed and seems to be a good choice. star allows block sizes up to 2 GByte if the system doesn't impose a smaller limit.
And if you want to determine the blocking factor when reading an unknown tar archive on tape? Specify a blocking factor that's higher than the supposed blocking factor of the tape. Then star will figure out the blocking factor by reading the first record of the tape and print a message:
star: Blocksize = # records.
Where # is the blocking factor in multiples of 512 bytes. The blocks= option and the bs= option are equivalent methods to specify the tape block size โ blocks= is preferred by people who like an option that behaves similar to the interface of the historic tar(1) implementations. ๐
The best method to set the blocksize is to use the bs=# option. That's the one. ๐
bs=#โ Set output block size to#. You may use the same method as indd(1)andsdd(1). The number representing the size is taken in bytes unless otherwise specified. If a number is followed directly by the letter.,w,b,k,m,g,t, orp, the size is multiplied by1,2,512,1024,1024*1024,1024*1024*1024,1024*1024*1024*1024or1024*1024*1024*1024*1024respectively. โจ
If the size consists of numbers separated by x or *, multiplication of the two numbers is performed. So bs=7x8k will specify a blocksize of 56 kBytes. Blocksize must be a multiple of 512 bytes. See also the description of the blocks= option for more details on blocksizes. The bs= option is preferred by people who like an option that behaves similar to the interface used by dd(1) and sdd(1). ๐
-bsdchdirโ Switch the behavior of theC=option to BSD style. The default behavior ofstaris to stay in a working directory until a newC=is seen. With BSD tar, theC=option is only related to the next file type argument. Different vibe, same letter.-bzโ Run the input or output through abzip2pipe. This option is an alias for-j. See the section COMPRESSION for details. ๐ฆC=dir-C dirโ Perform achdir(2)operation to dir before storing or extracting the next files. In all cases,starperforms thechdir(2)operation relative to the current working directory of the shell. (Yes, all cases. The shell's cwd is the anchor. โ)- In list mode (with the
-tflag),starignores all-Coptions. Periodt. - In create mode (with the
-c,-rand-uflag),starwalks through all-Coptions and file type arguments. While a BSD derivedtar(1)implementation goes back to the current working directory after storing one file argument that immediately follows the-Coption,staronly changes the directory if a new-Coption follows. To emulate the behavior of a BSD derivedtar(1), add a-C .option after the file argument. ๐ซถ - In extract mode (with the
-x,-nand-diffflag),starbuilds a pattern list together with corresponding directories from previousC=diroptions and performs achdir(2)to the corresponding directory of a matching pattern. Allpat=options that do not follow aC=diroption are interpreted as if they were preceded by a-C .option. See EXAMPLES for more information. ๐
- In list mode (with the
compress-program=nameโ Set a named compress program. See the section COMPRESSION for details. ๐ฅ-copydlinksโ Try to recursively copy the content of linked directories instead of creating the link. This is an experimental feature that may help to unpack archives on DOS. (Experimental means experimental, bestie. Tread carefully. ๐)-copyhardlinksโ This option lets you copy hardlinked targets rather than creating the link. It helps extract tar files on systems that don't implement hardlinks (e.g. BeOS). ๐ธ-copylinksโ This option lets you copy both hard- and symlinked targets rather than creating a link. It helps extract tar files on systems that don't implement links (e.g. OS/2). To extract and copy all symlinks correctly, you may need to callstartwice, becausestarcannot copy files that appear in the archive later than a symlink pointing to them. ๐ญ Two passes, no shortcuts.-copysymlinksโ This option lets you copy symlinked targets rather than creating a symbolic link. It helps extract tar files on systems that don't implement links (e.g. OS/2). Same deal as above โ to extract and copy all symlinks correctly, you may need to callstartwice, becausestarcannot copy files that appear in the archive later than a symlink pointing to them. ๐-cpio-statisticsโ Instead of thestarflavor of the statistics, print statistics incpioflavor. Choose your aesthetic. ๐-ctimeโ If used with the list command, this listsctimerather thanmtimeif the archive format isstar,xstar,xustar,exustar, orpax/epax.
If star is run as root and -ctime is used with the extract command and the same archive formats, this causes star to try to restore even the ctime of a file by generating time storms โ๏ธ.
You should not do this when in multi user mode, because this may confuse programs likecronand the news system. Althoughstartries to eliminate the accumulative effects of the time storm, there is a tendency for the system clock to slow down a bit. The clock typically lags about one millisecond per extracted file. Use with care and check the system clock after using this feature. ๐
If used with the create command, this changes the behavior of the newer= option. In that case star compares the ctime of all files to the mtime of the stamp file, rather than comparing the mtimes of both files. โจ
-cumulativeโ A shorthand for-dump-cumulative. See-dump-cumulativefor more information. (Short and sweet, she said what she said. ๐)-Dโ bestie, this one says do NOT descend into directories when you're in create mode. Normally star just goes full main character and walks the whole tree if it bumps into a directory in its file parameters. Fun lil' fact:-Dis in effect by default if you're using thelist=fileoption. But if you actually want star to descend into directories it finds in that list file? Use the-dodescoption (it's further down, keep scrolling ๐ ).-dโ do not store/create directories. Periodt. Here's the lore: old-schooltarversions, like the one that shipped with the seventh edition of UNIX, literally could not handle directories inside tar archives ๐ญ. So if you build a tar archive with no directories in it, you dodge all the problems withtarimplementations on SYSVr3 and earlier. And if you use it during extract, no intermediate missing directories get created either. Iconic avoidance strategy fr fr.-data-change-warnโ if a file's size changes while it's being archived, this treats that whole situation as just a warning only, and it will not cause a non-zero exit code. A warning message still gets written though, unless the condition is otherwise ignored by another rule from anerrctl=option. This option works as if the last error control option was:
errctl="WARN|GROW|SHRINK *"
Heads up: the -e option, or an ABORT entry in a condition set up by errctl=, has a higher precedence than -data-change-warn. Also this option is ignored in extract or list mode. ๐
-debugโ prints debug messages. Among other things you get debug messages for header type recognition, tar type properties, EOF recognition, opening of remote archives, and fifo internals. Detective mode activated ๐diffopts=optlstโ a comma separated list of diffopts. The valid members in optlst are:helpโ prints a summary of the possible members of the diffopts list.!โ inverts the meaning of the following string. No comma needed after the exclamation mark.notโ inverts the meaning of all members in the diffopts list, i.e. it excludes all present options from an initially complete set compare list. PSA: when you're usingcsh(1)you might have problems using!because of its strange parser โ that's literally why thenotalias exists. ๐ซถpermโ compares file permissions. With this option in effect, star compares the low order 12 bits of thest_modefield.modeโ same asperm.sympermโ compares permissions even in the case that the target file on the local filesystem is a symbolic link. By default, star will not compare the permission of symbolic links, since most systems can't set the permission of symbolic links. Star comparessympermonly ifpermis compared also.typeโ compares file type. Note that star cannot compare the file type in the case of a hard link.nlinkโ compares link count on hardlinks for all types of files. This only works if the archive is inexustarformat and contains star's dump extensions.dnlinkโ compares link count on hardlinks for directories. If comparingdnlinkis excluded butnlinkis not excluded, this lets you deal with filesystems that differ in their directory implementation. Here's the tea: the link count of directories in POSIX is equal to the number of manually created additional hard links + 1 (as with other file types), while on historical UNIX filesystems it equals the number of sub-directories + 2 + number of manually created additional hard links. This only works if the archive is inexustarformat and contains star's dump extensions.uidโ compares the numerical user id of file.gidโ compares the numerical group id of file.unameโ compares the ASCII version of user id of file. The user name is mapped via the file/etc/passwd.gnameโ compares the ASCII version of group id of file. The group name is mapped via the file/etc/group.idโ shorthand for:uid,gid,uname,gname. Compares all user/group related info of file. Note that this will always find differences if the source and target system use different user or group mappings.sizeโ compares file size. Note that star cannot compare the file size in the case of a hard link.dataโ compares content of file. If star already found that the sizes of the files differ, it will not compare the content anymore. If the sizes of the files differ, star will always report different data.contโ same asdata.rdevโ compares major/minor numbers for device nodes.hardlinkโ compares target of hardlinks.symlinkโ compares target of symlinks. This evaluates the paths returned by thereadlink(2)call.
Two symlinks are considered equal if they either have a characterwise identical link-name, or if they either both use an absolute path name or both use a relative path name and the following is true: both symlinks point to the same file that must exist, or both pathnames look similar enough.
sympathโ compares the target pathnames of symlinks. This characterwise compares the strings returned from thereadlink(2)call.sparseโ compares if either both files are sparse or not. If only one of both files is sparse, then a difference is flagged. This only works if the archive format isstar,xstar,xustar,exustar, orgnutar.atimeโ compares access time of file. This only works if the archive format isstar,xstar,xustar,exustar, orpax/epax.mtimeโ compares modification time of file.ctimeโ this only works if the archive format isstar,xstar,xustar,exustar, orpax/epax.lmtimeโ compares the modification time even in the case that the target file on the local filesystem is a symbolic link. By default, star will not compare the modification time of symbolic links, since most systems can't set the modification time of symbolic links. Star compareslmtimeonly ifmtimeis compared also.timesโ shorthand for:atime,mtime,ctime.nsecsโ checks nanoseconds in all selected timestamps as well.
Ngl, the time resolution of various filesystems differs. While modern filesystems like ZFS, and filesystems that introduced a sub-second resolution recently, tend to support a nanosecond granularity, filesystems like UFS that have supported a sub-second resolution since the early 1990s tend to support only a microsecond granularity. Since even in in 2018, the POSIX.1-2008 feature pathconf(_PC_TIMESTAMP_RESOLUTION) has not yet been implemented on any platform, you may need to disable comparing nanoseconds in some cases.
Star currently first tries to compare the timestamps based on a nanosecond resolution, and if that fails and one timestamp seems to have a microsecond resolution, the comparison is repeated with microsecond resolution only.
dirโ compares the content of directories. This only works if the archive is inexustarformat and contains star's dump extensions. Together with an increased verbose level (-vv) this will print a list of files that are only in the archive and a list of files that are only on the current filesystem. ๐xtimesโ shorthand for:atime,mtime,ctime,lmtime.aclโ compares access control lists. This only works if the archive is inexustarformat and has been created with star's-acloption. You need to specify the-acloption in addition when running the diff.xattrโ compares extended file attributes. This only works if the archive is inexustarformat and has been created with star's-xattroption. You need to specify the-xattroption in addition when running the diff.fflagsโ compares extended file flags. This only works if the archive is inexustarformat and has been created with star's-xfflagsoption. You need to specify the-xfflagsoption in addition when running the diff.
If optlst starts with a ! the meaning of all members in optlst is inverted, as with the not optlist member. In that case, star starts with a complete list that includes atime and lmtime. Reasonable diff options to use when comparing against a copy of a directory tree are diffopts=!atime,ctime,lmtime.
If diffopts are not specified, star compares everything but the access time of the files and the modification time of symbolic links. ๐
dir-group=groupโ if star extracts archives as root, this option lets you control the group id of intermediate directories created by star.dir-owner=userโ if star extracts archives as root, this option lets you control the owner of intermediate directories created by star.-dirmodeโ if you're in create mode (i.e. when storing files to archive), star stores directories past the corresponding files. This guarantees that even old tar implementations without a directory cache will be able to restore the correct times of directories. The-dirmodeoption should only be used if the archive needs to be extracted by an old tar implementation. And if star is used to extract an archive that was created with-dirmode, the directories will not get an old time stamp unless the option-Uis used while extracting the archive. โจ-do-fsyncโ tells star to callfsync(2)for every file when in extract mode. This lets star check whether a file could be successfully extracted. See-no-fsyncfor more information. ๐ซก-dodescโ forces star to descend into directories it finds inside alist=file. Bestie, it's literally the same energy as-Dup above, so peek at that one too. Heads up tho:-dodesconly works in create mode. No create mode, no descendo. ๐-dumpโ lets you create archives with the same number of attributes as an archive made with thelevel=option, but without all the restrictions that come with a true dump. Slay.
The archive you get can be thought of as a level-less dump: it carries attributes similar to a level 0 dump, but it can span more than a single file system and doesn't need a -C option. It was originally introduced to make it easier to implement a star version that supports true incremental dumps, but it's still around because it gives extra benefits. star currently sets the archive type to exustar and, on top of that, archives more inode meta data inside POSIX.1-2001 extended headers. Peep the level= option and the section INCREMENTAL BACKUPS for more on true incremental dumps. ๐
-dump+โ works similar to-dumpbut creates more global archive header meta data, e.g. theSCHILY.volhdr.hostnametag. Lowkey a glow-up.
This helps you understand where a tar archive has been created. ๐ฆ
-dump-cumulativeโ tellsstarto do incremental dumps relative to the last incremental dump of the same level. Normally, incremental dumps with a level higher than 0 are done relative to the content of a previous dump with a lower level. If incremental dumps and restores are going to be used to synchronize filesystem content, every successive incremental dump will increase in size if-dump-cumulativeis not used. See the section SYNCHRONIZING FILESYSTEMS for more info. ๐dumpdate=nameโ tellsstarto use themtimeof the time stamp file name instead of using the start time ofstar. This is needed whenstaris run on file system snapshots. Ifstarused its own start time with snapshots, all files that have been modified between the setup of the snapshot and the start ofstarwould be missing from the backup. ๐ญ
A solution is to create the time stamp file, then create the snapshot, and later use the option dumpdate=name. ๐ง
-dumpmetaโ changes the behavior ofstarin incremental dump mode. If-dumpmetais used and only the inode change time (st_ctime) of a file has been updated since the last incremental dump,starwill archive only the meta data of the file (e.g.uid, permissions, ...) but not the file content. Using-dumpmetaresults in smaller incremental dumps, but files that have been created between two incrementals and set to an old date inst_mtime(e.g. as a result from a tar extract) will not be archived with full content.
Using -dumpmeta thus may result in incomplete incremental dumps, use with extreme care. Not me warning you twice. ๐
-eโ exit immediately with exit status-3(253) if any unexpected error occurs. The-eoption works as if the last error control option was
errctl="ABORT|ALL|DIFF *"
This allows one to use the errctl= option together with the -e option and thus to ignore some error conditions while aborting on all other conditions. Iconic combo, fr fr. ๐
errctl= nameerrctl= error control specโ add the content from file name to the error control definitions, or add error control spec to the error control definitions. More than one error control file, more than one error control spec, and even a mixture of both forms is possible. We love options. โจ
The reason for using error control is to make star quiet about error conditions that are known to be irrelevant to the quality of the archive or restore run, or to tell star to abort on certain error conditions instead of trying to continue with the archive.
A typical reason to use error control is to suppress warnings about growing log files while doing a backup on a live file system. Another typical reason is to tell star to abort if e.g. a file could not be archived, instead of continuing to archive other files from a list.
The error control file contains a set of lines, each starting with a list of error conditions to be ignored, followed by white space, followed by a file name pattern (see match(1) or patmatch(3) for more information). The error control spec uses the same syntax as a single line from the error control file. If the file name pattern needs to start with white space, use a backslash to escape the start of the file name. It is not possible to have new line characters in the file name pattern. Whenever an error situation is encountered, star checks the lines in the error control file starting from the top. If the current error condition is listed on a line in the error control file, then star checks whether the pattern on the rest of the line matches the current file name. If this is the case, star uses the current error control specification to control the current error condition. ๐ต๏ธ
The list of error conditions to be handled may use one or more identifiers (separated by a '|' character when there's more than one) from the list below:
ABORTโ if this meta condition is included in an error condition,staraborts (exits) as soon as possible after this error condition has been seen, instead of makingstarquiet about the condition. This error condition flag may only be used together with at least another error condition or a list of error conditions (separated by a'|'character).WARNโ if this meta condition is included in an error condition,starprints the warning about the error condition, but the error condition does not affect the exit code ofstarand the error statistics (which is printed at the end) does not include the related errors. This error condition flag may only be used together with another error condition or a list of error conditions (separated by a'|'character). TheWARNmeta condition has a lower precedence thanABORT.DIFFโ suppress output in case thatstar -diffdid encounter any differences.ALLโ this is a shortcut for all error conditions below.STATโ suppress warnings thatstarcould notstat(2)a file.GETACLโ suppress warnings about files on whichstarhad problems to retrieve the ACL information.OPENโ suppress warnings about files that could not be opened.READโ suppress warnings about read errors on files.WRITEโ suppress warnings about write errors on files.READLINKโ suppress warnings aboutreadlink(2)errors on symbolic links.GROWโ suppress warnings about files that did grow while they have been archived.SHRINKโ suppress warnings about files that did shrink while they have been archived.MISSLINKโ suppress warnings about files for whichstarwas unable to archive all hard links.NAMETOOLONGโ suppress warnings about files that could not be archived because the name of the file is too long for the archive format.FILETOOBIGโ suppress warnings about files that could not be archived because the size of the file is too big for the archive format.SPECIALFILEโ suppress warnings about files that could not be archived because the file type is not supported by the archive format.GETXATTRโ suppress warnings about files on thatstarcould not retrieve the extended file attribute information.CHDIRโ suppress warnings aboutchdir(2)errors.ICONVโ suppress warnings abouticonv(3)errors. These errors happen when text is converted from or to POSIX.1-2001 extended tar headers.IDโ suppress warnings aboutuid/gidrange errors. These errors happen when the archive format does not support the actual value.SETTIMEโ suppress warnings about files on thatstarcould not set the time information during extraction.SETMODEโ suppress warnings about files on thatstarcould not set the access modes during extraction.SECURITYโ suppress warnings about files that have been skipped on extraction because they have been considered to be a security risk. This currently applies to all files that have a'/../'sequence inside when-..has not been specified.LSECURITYโ suppress warnings about links that have been skipped on extraction because they have been considered to be a security risk. This currently applies to all link target names that start with'/'or have a'/../'sequence inside when-no-secure-linkshas not been specified. In this case,startries to match the link name against the pattern in the error control file.SAMEFILEโ suppress warnings about links that have been skipped on extraction because source and target of the link are pointing to the same file. Ifstarwould not skip these files, it would end up with removing the file completely. In this case,startries to match the link name against the pattern in the error control file. ๐ญBADACLโ suppress warnings about access control list conversion problems.SETACLโ suppress warnings about files on thatstarcould not set the ACL information during extraction.SETXATTRโ suppress warnings about files on thatstarcould not set the extended file attribute information during extraction.
If a specific error condition is ignored, then that error condition is not only handled in a silent way but also excluded from the error statistics that are printed at the end of the star run. ๐
Okay bestie, be very careful when using error control, because you may ignore any error condition. If you ignore the wrong error conditions, you may not be able to see real problems anymore. ๐ญ That's the whole trap. Do not do that to yourself.
-exclude-fromname โ Exclude from *name*d file. This is just an alias for the-Xoption, so go read-Xfor the real tea. ๐-F,-FF, ... โ The fast and simple exclude option, but only for create mode. The moreFs you stack, the more it ignores, so let's count them like a choreography: ๐บ- One
-Fargument: star ignores all directories calledSCCSandRCS. - Two
-Farguments: star in addition ignores all files calledcore,errs,a.out, all files ending with.o, andOBJ/. - Three
-Farguments: star ignores all sub trees starting from a directory that includes a file.mirroror.exclude, plus all object files and files calledcore,errs,a.out, all files ending with.o. - Four
-Farguments: star ignores all sub trees starting from a directory that includes a file.mirroror.excludeโ and those latter files are excluded too โ as well as all object files and files calledcore,errs,a.out, all files ending with.o. - Five
-Farguments: star in addition again excludes all directories calledSCCSandRCS. Full circle, we love a comeback. ๐
- One
f=tarfilename โ Use tarfilename as the name for the tar archive. Same thing as thefile=tarfilename option, just shorter. โจ-fifoโ Use a fifo to optimize the data flow from/to tarfile. This option is in effect by default (it may be changed at compile time, so like, don't @ me). The default fifo size is 8 MBytes on all platforms except Linux versions that do not supportmmap()(4 MB, because kernels before 2.4 did not handle big shared memory areas) and Sun/mc68000 (1 MB). This is what makes star even work on a tiny machine like a Sun 3/50. ๐ฅบ The fifo size may be modified with thefs=option.- Rule of thumb for the fifo size: use more than the buffer size of the tape drive and less than half of the real memory of the machine. A good choice would be a fifo size between 8 and 256 MB.
- This may increase backup speed up to 5% compared to the speed achieved with the default fifo size. Slay. ๐
- Note that with a DLT drive from y2000 that gives 12MB/s transfer rate, a fifo of 256 MB size will keep the tape at least streaming in units of 20 seconds.
- Future LTO tape drives are expected to implement transfer rates of aprox. 3GB/s and need a much larger fifo size to keep the tape streaming. ๐ฅ
- > All options that start with the
-fsequence are sensitive to typo problems, see BUGS section for more information. Typo on an-foption and it's over for you, fr fr.
-fifostatsโ Print fifo statistics at the end of a star run when the fifo has been in effect. Cute little receipts. ๐งพ All options that start with the-fsequence are sensitive to typo problems, see BUGS section for more information.file=tarfilename,f=tarfilename โ Use tarfilename as the name for the tar archive. Currently up to 100file=options are possible. Specifying more then onefile=option make sense in multi volume mode โ in this case star will use the next name in the list every time a media change is needed. To make star behave consistent with the single file case, star loops over the list of known archive files. ๐- Note that if star is installed suid root and the first tarfile is a remote archive, only the connection to this archive will be created with root privileges. After this connection has been established as root, star switches back to the id of the caller. If any of the other archives in the list is located on a different host, star will not be able to open this archive later on, unless run by root. ๐
- Star normally uses stdin/stdout for the tar archive, because the most common way to use star is in conjunction with pipes. If star is installed suid root or if it has been called by root, tarfilename may be in remote syntax:
user@host:filenameas inrcp(1)even if invoked by non root users. See SUID NOTES for more information. - To make a file local although it includes a colon (
:), the filename must start with:'/','./'or'../' - Note that if star talks to an old rmt remote tape server that does not support symbolic open modes, it does not open a remote tape with the
O_CREATopen flag, because this would be extremely dangerous. If the rmt server on the other side is the rmt server that comes with star or the GNU rmt server, star may use the symbolic mode for the open flags. Only the symbolic open modes allow sending all possible open modes in a portable way to remote tape servers. - It is recommended to use the rmt server that comes with star. It is the only rmt server that gives platform independent compatibility with BSD, Sun and GNU rmt clients, and it includes security features that may be set up in
/etc/default/rmt. ๐ All options that start with the-fsequence are sensitive to typo problems, see BUGS section for more information. - See
-rshoption on how to set up a different protocol for the connection to the remote tape server. - See ENVIRONMENT section for information on how to use
ssh(1)to create a remote tape server connection. - Note that if
file=-has been specified, it is no longer possible to use the-find-execprimary.
-findโ This option acts as a separator. If it is used, all star options must be to the left of the-findoption. To the right of the-findoption, star accepts the find command line syntax only. So think of-findas the velvet rope. ๐- The find expression acts as a filter between the source of file names and the consumer, which may either be the archiving engine or list/extract engine. If the find expression evaluated as TRUE, then the related file is selected for processing, otherwise it is omited.
- In order to make the evaluation of the find expression more convenient, star implements additional find primaries that have side effects on the file meta data. Star implements the following additional find primaries:
-chatimetimespec โ The primary always evaluates as true; it modifies the time of last access of a file instruct stat. Seesfind(1)for a description of timespec.-chctimetimespec โ The primary always evaluates as true; it modifies the time of last status change of a file instruct stat. Seesfind(1)for a description of timespec.-chmtimetimespec โ The primary always evaluates as true; it modifies the time of last modification of a file instruct stat. Seesfind(1)for a description of timespec.-chgrpgname โ The primary always evaluates as true; it sets the group of the file to gname.-chmodmode โ The primary always evaluates as true; it sets the permissions of the file to mode. Octal and symbolic permissions are accepted for mode as withchmod(1).-chownuname โ The primary always evaluates as true; it sets the owner of the file to uname.-falseโ The primary always evaluates as false; it allows one to make the result of the full expression different from the result of a part of the expression.-trueโ The primary always evaluates as true; it allows one to make the result of the full expression different from the result of a part of the expression.
- The command line:
star -c f=o.tar -find . ( -type d -ls -o false ) -o ! -type d
lists all directories and archives all non-directories to the archive o.tar.
- The command line:
star -c f=o.tar -find . ( -type d -chown root -o true )
archives all directories so they appear to be owned by root in the archive, all non-directories are archived as they are in the file system.
- Note that the
-ls,-execand the-okprimary cannot be used if stdin or stdout has been redirected by thelist=-of by thefile=-options.
-force_holeโ obsoleted by-force-hole-force-holeโ Try to extract all files with holes. This even works with files that are created without the-sparseoption. Star, in this case, examines the content of the files in the archive and replaces writes to parts containing binary zeroes with seeks. ๐ณ๏ธโจ- If used together with the
-sparseoption in create mode, star assumes all files to be sparse and archives files with blocks of nulls as sparse files. - > This option should be used with extreme care, because you sometimes get in trouble when files get unattended holes. ๐ญ All options that start with the
-fsequence are sensitive to typo problems, see BUGS section for more information.
- If used together with the
-force_removeโ obsoleted by-force-remove-force-removeโ Force to remove non writable files on extraction. By default, star will not overwrite files that are read only. If this option is in effect, star will silently remove these files to allow the extraction of a file. ๐ All options that start with the-fsequence are sensitive to typo problems, see BUGS section for more information.-force-restoreโ Force an incremental restore even if there is a dump level mismatch or a reference date mismatch. See-wtardumps,level=and sections INCREMENTAL BACKUPS and INCREMENTAL RESTORES for more information. ๐ฆ-freezeโ Run the input or output through a freeze pipe. See section COMPRESSION for details. ๐งfs=#โ Set fifo size to#. Seebs=for the possible syntax.- The default size of the fifo is 1 Mbyte on Sun mc68000 systems, 4 Mbytes on non
mmap()aware Linux systems and 8 Mbytes on all other systems. See-fifooption for hints on using the right fifo size. ๐ธ
- The default size of the fifo is 1 Mbyte on Sun mc68000 systems, 4 Mbytes on non
fs-name=mount_pointโ when star writes stuff into/etc/tardumps, and when it's comparing against what's already in/etc/tardumpsfor incremental backups, it should use mount_point instead. Why tho? Because if you're backing up from a filesystem snapshot, your real filesystem is chillin' at some temporary mount point while the snapshot does its thing โ and this option lets/etc/tardumpsand the archive carry the actual real name of the filesystem instead of that temporary snapshot mount point. It's giving "let me use my government name". ๐H=headertypeโ same deal as theartype=headertypeoption, go look at that one. But heads up bestie: POSIX.1-2001 defines an option-Hthat follows symbolic links encountered on the command line. So because of that, the old starH=headertypeoption may go away in the future โ even though this option has literally been in use bycpiosince 1989. Rip to a legend fr. ๐ญ-h,-Lโ follow symbolic links as if they were actual files. Normally star does not follow symlinks, it just stores their values in the tarfile. See also the-Loption (it's the same thing, they're twins). ๐ซถ-hardlinksโ in extract mode, this tells star to try and create a hardlink whenever it bumps into a symlink in the archive. In create mode, it tells star to try and archive a hardlink whenever it bumps into a symlink in the filesystem. Same energy, opposite direction. โจ-hpdevโ allow 24 bits for the minor device number, using 8 octal digits. Okay but listen โ even though this lets you make tar archives that HP-UXtarcan read, it also makes tar archives that violate POSIX.1-1988. ๐จ You only need this if you're into using a POSIX.1-1988 based archive format that doesn't include extensions. And for the record: if you use thexstarformat, star uses a base 256 extension that allows bigger major/minor numbers by default, and if you usexustarorexustarthere's no limitation at all because those formats use POSIX.1-2001 extended headers to archive the major/minor numbers by default. So likeโฆ you probably don't need-hpdev. ๐-iโ ignore checksum errors on tar headers. If you pass this, star will not exit when it finds a header with a bad checksum โ instead it goes hunting for the next valid header. Iconic scavenger behaviour. ๐ฅ-installโ carefully replace existing files when extracting. It works kinda likeinstall(1): star first extracts the files into a temporary name, and only renames the file to its final name once that file's extraction was successful. No half-extracted chaos, we love a clean handoff. ๐
But bestie, careful โ star by default does not remove non-empty directories. So an install that needs to remove existing non-empty directories may also need the options-force-removeand-remove-recursive. Don't say I didn't warn you. โ ๏ธ
iskip=#โ set the initial skip size to #. Seebs=for the possible syntax. The skip size is the number of bytes to ignore from the first tape record. This is typically used when a tar archive on a tape isn't being read from the beginning and the tape got forwarded before it was read. Soiskip=specifies the offset of the first archive header within the current tape record. It does not work on compressed archives. periodt. ๐-jโ run the input or output through abzip2pipe. It's an alias for-bz. See section COMPRESSION for the deets. ๐-keep-nonempty-dirsโ do not complain about trying to remove nonempty directories in the case that-remove-recursivehasn't been specified. Like, star will just be chill about it. ๐ฆ-keep_old_filesโ obsoleted by-keep-old-files. It's giving legacy. ๐-keep-old-files,-kโ keep existing files rather than restoring them from the tarfile. This saves your files from being clobbered even if the tarfile contains a more recent version of the corresponding file. Your files, your rules. ๐
See SECURITY NOTES for more information.
-L,-hโ follow symbolic links as if they were files. Normally star will not follow symbolic links but stores their values in tarfile. See also the-hoption. (Yes this is the same as the-h,-Lentry above, they really said "documented twice, no regrets".) ๐-lโ do not print a warning message if not all links to hard linked files could be dumped. Okay so this one is backwards and it's a whole thing: this option is evaluated in the opposite way to historictar(1)implementations and to POSIX.1. POSIX.1 requests that by default no warning messages get printed, and-lenables warning messages when not all links could be archived. So star does the reverse. Wild, but there it is. ๐ญlevel=dumplevelโ set the level for incremental dumps. This switches star into true incremental dump mode. The dumplevel may be in the range between 0..99.
In true incremental dump mode, a -C option followed by the name of a mount point and a dot (.) as the starting directory name is required. Only a single filesystem may be handled at a time. If the directory following -C doesn't refer to a root directory of a filesystem, the dump is called a partial dump. If the directory following -C does refer to a root directory of a filesystem and no other restrictions apply that exclude certain files from the dump, the dump is called a full dump. ๐
By default, the tardumps database is not written. See also the tardumps=name and -wtardumps options, plus the section INCREMENTAL BACKUPS for more.
-link-dataโ in create mode, include the data for files even if those files are hard links. Important: this feature in create mode is currently only available for theexustararchive format, and only in the case that-sparsehas not been specified. Very specific, very exclusive. ๐
In extract mode, it allows star to deal with data in hard linked files even if the standard wouldn't allow this for the used archive format. Breaking the rules a little, as a treat. โจ
-link-dirsโ in create mode, try to find hard linked directories. Using-link-dirsforces star to keep track of all directories that go into the archive, which means a lot more memory gets allocated than in the default case. Consider yourself warned.
If you want to extract a cpio archive that contains hard linked directories, you also need to specify -link-dirs in extract or diff mode. Why? Because many cpio implementations create buggy archives with respect to hard links, and if star looked for hard linked directories in all cases it would detect tons of pseudo hard links to directories. So use -link-dirs with care if you extract cpio archives. ๐
Note that not all filesystems allow creating hard links to directories. Also note that even though a non-root user can detect and archive hard linked directories, all known operating systems require the extraction to be done as root in order to create or remove hard links to directories. For this reason it's only recommended to use this option when doing accurate backups and when hard links to directories are expected. ๐
When -link-dirs is not used and hard links to directories are present, the appendant sub-tree will appear more than once on the archive, and star will print Linkcount below zero warnings for non directory hard links inside the sub-tree. Messy, we hate to see it. ๐
list=filenameโ read filenames for the store/create/list/diff command from filename. That file must contain a list of path names, each on a separate line. This option implies the-Doption. To force star to descend directories, use the-dodescoption in this case. See also the-Xoption. ๐
If used together with -find, no path list is accepted after the -find option.
See also the pkglist= option for a way to specify filename, permission, owner and group.
Note that iflist=-has been specified, it is no longer possible to use the-find -execprimary. So pick your fighter. ๐ฅ
-lowmemโ try to run with reduced memory requirements. This makes star default to 1 MB of FIFO memory. And instead of allocating memory to hold the directory content and reading the directory all at once, star reads the directory name by name. Which sounds cute until: this may cause star to close the directory if it runs out of file descriptors because of deeply nested directories. And if a directory then doesn't supporttelldir(3)/seekdir(3), star will fail. So it's a trade-off bestie. ๐-lzipโ run the input or output through alzippipe. See section COMPRESSION for details. ๐ธ-lzmaโ run the input or output through alzmapipe. See section COMPRESSION for details. ๐-lzoโ run the input or output through alzoppipe. See section COMPRESSION for details. ๐ฆ-M,-xdevโ do not descend mount points. Super useful when you're backing up complete filesystems. See NOTES for more info. ๐
When using -find, this may not always work as expected โ e.g. when the /proc filesystem is involved. For this reason, use -xdev past -find. Order matters, bestie. โจ
-mโ do not restore access and modification time. (Access time is only available if star is readingstar,xstar,xustar,exustar, orpax/epaxarchives.) If star extracts other archive types, the-mflag only refers to the modification time. So like, sometimes it's both, sometimes it's just the one. Depends on the archive. ๐-match-treeโ if in create mode a pattern doesn't match a directory, and-match-treehas been specified, the whole directory tree is excluded from the archive and from further directory scans. By default star excludes the directory but still recursively scans the content of that directory, because complex patterns could allow files inside the directory tree to match. Using-match-treelets you efficiently exclude whole trees from scanning. This helps avoid scanning directory trees that are on remote filesystems or that contain excessive bad blocks. Big efficiency slay. ๐ฅmaxsize=#โ do not store files in tarfile if they're bigger than #. Seebs=for the possible syntax. By default, the number is multiplied by 1024, so the value counts in units of kBytes. If the size specifier ends with a valid multiplication character (e.g..for bytes orMfor MB), the specified size is used as specified and not multiplied by 1024. See thebs=option for all possible multipliers. ๐-metaโ in create mode,-metacauses star to archive all meta data of the file (e.g. uid, permissions, ...) but not the file content. In extract mode, it causes star to restore all meta data but not the file content. On top of that, in extract mode no plain file, special file or directory will be created. Meta files are needed to support incremental backups. It's giving "just the vibes, not the substance". โจ
โ ๏ธ BESTIE. LISTEN TO ME. REAL TALK. Do not try to extract star archives that contain meta files using other tar implementations โ not unless those implementations actually know about star's meta file extensions. Star literally tries to force every tar implementation that isn't standard compliant to abort. It also tries to make every non-POSIX.1-2001-compliant tar implementation unable to find a valid filename. But โ and this is the part that hurts ๐ญ โ when other POSIX.1-2001-aware tar implementations show up and don't know about meta files, they will destroy files on disk.
Where's all this chaos coming from? It's the only current fallback in the POSIX standard, which tells tar implementations to treat all unknown file types as if they were plain files. And since meta files are needed for incremental backups, the author is out here looking for people and companies who'd like to support him so he can add the meta file concept to the POSIX.1-2005 standard. ๐ซถ (Yes, this is a real plotline in the tar cinematic universe.)
-modebitsโ this one lets you create tar archives that include more than 12 bits fromst_mode. Heads up though: this creates tar archives that violate POSIX, but some tar implementations genuinely insist on reading such nonstandard archives. ๐mtskip=#โ sets the initial archive skip amount to #. Peepbs=for the possible syntax.
So what even is the archive skip size? It's the number of 512 byte blocks to ignore before star starts reading the archive. Typically you'd use the value printed by the -block-number option as the parameter. โจ
This is the move when a tar archive on a tape isn't being read from the very beginning and you wanna fast forward to a specific file. And check the -one-file option for a way to extract only one file from the archive.
If the archive is a plain file, this option results in an lseek() call to the input file. If the archive is a magnetic tape, this option results in a mtioctl(MTFSR) call for the part of the blocks that can be represented by the tape block size, followed by a skip of the remainder of the blocks. Since star learns the tape block size from the first read() call, this option does not work correctly if the tape block size used by star doesn't match the tape block size on the medium. See the blocks=# option above for the tea on tape block size. ๐ต
Also: if mtskip=# has been specified, an iskip=# option is ignored, and the value is instead computed from the mtskip=# parameter. And mtskip=# does not work on compressed archives. Noted. ๐
-multivolโ switches to multi volume mode. In multi volume mode, there will be no logical EOF marker written to the end of a single tape. If-multivolis used in read mode, a hard EOF on input (if not preceded by a logical EOF) triggers a medium change operation.
Specifying -multivol tells star to split files across volumes if needed. This way, a virtual archive gets created that spans more than one medium. Multi volume mode is needed whenever it's not possible to split the archiving or extracting into several logically independent tasks โ true for e.g. incremental dump/restore operations, where inode numbers need to be traced for the whole task. ๐
When tsize=# has been specified but star is not in multi volume mode, files cannot be split across volumes.
When -multivol has been specified in create mode together with tsize=#, then a media change is initiated exactly after an amount of tsize data has been written. When -multivol has been specified in create mode and tsize=# has not been specified, then the medium change is triggered by an EOT condition from writing the medium. This lets you use media where the size can't be known in advance (e.g. tapes with built-in compression); it does not work if the EOT condition isn't returned in sync with the related write operation. For this reason, it's expected that data buffering inside a device driver cannot be used. ๐
Depending on the selected archive format, star writes a volume header at the beginning of a new medium. This medium header lets you verify the correct volume after a change during read back. It's recommended to use the exustar format for best results. In create mode, -multivol is only supported for archive types that allow writing reliable multi volume header information. ๐
See the tsize=# option for more information.
Heads up bestie:-multivolis an interactive option that prevents star from being used in non-interactive environments. If you wanna use it in a non-interactive environment, you need to also specifynew-volume-script=scriptin order to automate the media change procedure. ๐
newer=filenameโ don't store files to tarfile if their modification time is not newer than the modification time of filename. See the-ctimeoption for changing this behavior. ๐ฐ๏ธ-newestโ in conjunction with the list command, this lists you only the newest file in tarfile.-newest_fileโ obsoleted by-newest-file.-newest-fileโ in conjunction with the list command, this lists you only the newest regular file in tarfile.new-volume-script=scriptโ calls script at the end of each tape (even the last one) if in multi volume mode, or if thetsize=option has been specified. If this option isn't in effect, star will ask the user to confirm the volume change. The script is called with two parameters: the first parameter is the next volume number, and the second parameter is the next archive file name. ๐ฆ-nodumpโ if this option is set, star will not dump files that have the nodump flag set. Note that this currently only works on BSD-4.4 derivates and on Linux. On Linux, using this option will cause a performance degradation โ the system time increases by 10% โ because of the unlucky kernel interface that requires a separateopenandioctl. ๐-no-dirslashโ do not add a slash to the end of directory names if writing to an archive. Historic tar archive formats only allowed specifying plain files and hard links. Around 1980, BSD added a feature to specify a directory on tape by adding a slash to the end of the name. POSIX.1-1988 defined the first official tar archive format that had a clean method to specify the type of a directory. And since old tar formats need that slash to recognize a directory,-no-dirslashmay not be used if archives should be compatible with the old tar format. ๐ผ-no_fifoโ obsoleted by-no-fifo.-no-fifoโ don't use a fifo to optimize data flow from/to tarfile. Currently the-fifooption is used as default. (This may be changed at compile time.) โจ-no-fsyncโ do not callfsync(2)for each file that has been extracted from the archive. Using-no-fsyncmay speed up extraction on operating systems with slow file I/O (such as Linux with any filesystem, or platforms with Copy on Write filesystems like ZFS), but it includes the risk that star may not be able to detect extraction problems that occur after the call toclose(2). A typical cause for such problems is an NFS file system that fills up before the buffer cache is synced, or a write error that occurs while the buffer cache is synced. There may be other reasons. Use with extreme care. ๐ญ
See also -do-fsync and STAR_FSYNC in ENVIRONMENT and /etc/default/star for ways to configure the default behavior. ๐
-nochown,-oโ do not restore owner and group of files. This may be used if super user privileges are needed to overwrite existing files, but the local ownership of the existing files should not change. ๐-no-pโ do not restore files and directories to their original permissions. This option is needed only if star is called by the super user and the permissions should not be restored from the archive. See also the-poption. The-poption has a higher precedence than the-no-poption. โญ-no_statisticsโ obsoleted by-no-statistics.-no-statisticsโ do not print statistic messages at the end of a star run.-no-secure-linksโ extract hard links or symbolic links even if the target of the link starts with a slash (/) or if/../is contained in the link target. See the description of the option-secure-linksbelow, andSTAR_SECURE_LINKSin ENVIRONMENT and/etc/default/starfor ways to configure the default behavior. ๐-no-xheaderโ do not create or extract POSIX.1-2001 extended headers. This option may be used if you like to read an archive with broken extended headers. ๐ฉน-not,-Vโ invert the meaning of the pattern list, i.e. use those files which do not match any of the pattern. Note that this option only applies to patterns that have been specified via thepattern=patternorpat=patternoption. Patterns specified as file type arguments will not be affected. ๐ โโ๏ธ-notarg,-pax-cโ match all file or archive members except those specified by the pattern or file operands.-nowarnโ do not print warning messages. This sometimes is useful to make the output more readable (e.g. when hundreds of files that are going to be extracted are not newer in the archive than on the filesystem). ๐คซ-numericโ use the numeric user/group fields in the listing rather than the default. The default allows you to list the ASCII version of user/group of the file, and to extract the owners of the files based on numeric values rather than the names. In create mode, no user/group names are put on the archive. The-numericoption also applies when ACLs are going to be archived or extracted. ๐ข-Oโ be compatible with the old versions oftar. ๐ซถ Ifstargets invoked with this, it generates archives that are fully compatible with old UNIXtararchives. In extract mode,starjust ignores any extra info in the headers. But bestie, listen: this implies neither that archives made with this option are binary-equal to archives made by oldtarversions, nor thatstaris trying to comprehend every bug found in oldtarversions. The bug in oldtarversions that causes a reversal of a space and a NULL byte in the checksum field is not repeated. If you want signed checksums you have to specify the-signed-checksumoption too. And if you want directories not to be archived (for compatibility with very old historictararchives), you need to specify the-doption too.
This option is superseded by the H=headertype option.
-o,-nochownโ do not restore owner and group of files. ๐ซ This may be used if super user privileges are needed to overwrite existing files but the local ownership of the existing files should not change.-one-fileโ exitstarafter one file has been extracted as a result of a match with a pattern or with a command line argument. โจ This option is intended for users that need to restore single files from larger tape archives and do not like to wait until the end of the tape is reached. To letstarexit after the first file, call-one-filetogether withpat=*. This is e.g. useful together with the optionmtskip=#.-onull,-nulloutโ do not actually write to the archive, but compute and add the sizes. ๐ญ This is useful when trying to figure out if a tape may hold the current backup. Please only use the-onulloption, as it is a similar option as used by thesdd(1)command.-Pโ allowstarto write a partial record as the last record. Normally,starwrites each record with the same size. This option is useful on unblocked tapes, i.e. cartridge tapes like QIC tapes, as well as with archives that are located in files. If you use this option on local files, the size of the archive will be smaller. If you use this option on cartridge tapes, it makes sure that later โ in extract mode โstarwill read up to the end of file marker on the tape, and the next call tostarwill read from the next archive on the same tape. ๐ผ-pโ restore files and directories to their original permissions. ๐ Without this option, they are created using the permissions in the archive and the presentumask(2). Ifstaris called by the super user,starbehaves as if it has been called with the-poption. See also-no-poption. If the archive contains Access Control Lists (ACLs) in POSIX.1-2001 extended headers,starwill restore the access control lists from the archive for files if the-acloption is specified. If the option-aclhas not been specified, ACLs are not restored at all. ๐-partialโ force an incremental restore even if the incremental dump is only a partial dump. See-wtardumps,level=and sections INCREMENTAL BACKUPS and INCREMENTAL RESTORES for more information.pattern=pattern,pat=patternโ set matching pattern to pattern. ๐ฏ A maximum of 100pattern=patoptions may be specified. As each pattern is unlimited in length, this is no real limitation. If more than one pattern is specified, a file matches if any of the specified patterns matches. Patterns may be used in create mode to select or exclude files from the list of file type arguments or the files located in a sub tree of a file type argument directory. By default,starscans the whole directory tree underneath a directory that is in the argument list. This may be modified by using the-match-treeoption. In extract or list mode, all file type arguments are interpreted to be select patterns, and all option type patterns may be either select or exclude patterns depending on the presence or absence of the-notoption. If you use file type select patterns, they work exactly like the method used by other (non pattern aware)tar(1)implementations. File type select patterns do not offer pattern matching but allow restoring subtrees. To extract a complete sub tree from the directory dir withstarusing thepattern=option, usepattern=dir/\*. If you like to select a subtree by using the historic method, use dir as file type argument. If you only like to extract the directory itself, usedir/as file type argument. See manual page formatch(1)for more details of the pattern matcher. All patterns are selection patterns by default. To make them exclude patterns, use the-notor the-Voption.pkglist=fileโ this is (for now) an internal interface for the Schily Source Package System (sps). ๐ ๏ธ It only works in create mode and behaves similar to thelist=option, but it allows one to overwrite the permissions, the uid and gid values from the content of thepkglist=file. Each line from thepkglist=file contains a file name followed by the permission, a user name and a group name. The permission is an octal character string. Each value that is not used to overwrite the original values may be replaced by a'?'. The fields are separated by spaces, so thepkglist=option does not allow files that contain newline or space characters.
If used together with -find, the uid, gid and permission values from the pkglist=file have precedence over changes on this meta data introduced by libfind.
See list= option for further information.
-pax-c,-notargโ match all file or archive members except those specified by the pattern or file operands. ๐ โ๏ธ-pax-Hโ follow symbolic links that have been encountered on the command line. If the referenced file does not exist, the file information and type will be for the link itself. If the link is referencing a file type that cannot be archived with the current archive format, the file information and type will be for the link itself. ๐-pax-iโ do interactive renaming in a way that has been defined for POSIXpax.starwill print the original filename and prompt for a reply. If you type just RETURN, then the file is skipped. If you type'.', then the original file name is retained. If you type anything else, then this is taken as the new file name.
Note that-pax-iis an interactive option that preventsstarfrom being used in non-interactive environments. ๐ญ
-pax-Lโ follow symbolic links. If the referenced file does not exist, the file information and type will be for the link itself. If the link is referencing a file type that cannot be archived with the current archive format, the file information and type will be for the link itself. ๐ฆ-pax-lsโ switch listing format to the format defined for POSIXpaxandls.-pax-matchโ allow file type arguments to be recognised as regular expressions in a way that has been defined for POSIXpax. โจ-pax-nโ allow each pattern to match only once. If a pattern matches a directory, then the whole sub tree matches the pattern. ๐ธ-pax-ostring โ set apaxlike option control pattern.
The only argument that is currently supported is binary to create a hdrcharset=BINARY header.
-pax-pstring โ PAX style privileges string. Several characters (each has its own meaning). ๐ The following characters are defined:aโ do not preserve file access times. This option is currently ignored.eโ preserve the user ID, group ID, file mode bits. This is equivalent to callingstar -p -acl -xfflags.mโ do not preserve file modification times. This is currently equivalent to callingstar -m.oโ preserve the user ID and group ID. This is the default forstarif called as root.pโ preserve the file mode bits. This is equivalent to callingstar -p.
-pax-sreplstr โ modify file or archive member names named by a pattern according to the substitution expression replstr. The format of replstr is:
-pax-s /old/new/[gp]
The old pattern may use regular expressions and the new string may contain the special character '&'. The character '&' is substituted by the string that matches the old pattern. The new string may also contain the special strings '\1' .. '\9' that refer to parts of the old string selected by '\(...\)' groups. The optional trailing 'g' means global substitution. If 'g' is not used, a substitution pattern is only used once on a name. If the optional trailing 'p' is used, the substitution is printed to standard error.
Up to 100 substitute options may be used. If more than one substitute option has been specified, star will loop over all substitute patterns until one matches. The up to 100 substitute options are processed together with the -s replstr options in the order they appear on the command line.
If the name substitutes to the empty string, the file is skipped.
If the target platform for star does not support regex functions, there is a silent fallback to the -s replstr option and the '\1' .. '\9' substitutions are not possible. ๐
-prinodesโ print inode numbers in verbose list mode if the archive contains inode numbers. ๐ข-print-artypeโ check the type of the archive, print the archive and compression type on a single line and exit. ๐-qic24โ set tape volume size to61440kBytes. Seetsize=#option for more information.-qic120โ set tape volume size to128000kBytes. Seetsize=#option for more information.-qic150โ set tape volume size to153600kBytes. Seetsize=#option for more information.-qic250โ set tape volume size to256000kBytes. Seetsize=#option for more information.-qic525โ set tape volume size to512500kBytes. Seetsize=#option for more information.-read0โ read null terminated file names from the file specified with thelist=option. ๐-refresh_old_filesโ obsoleted by-refresh-old-files๐ bestie this one's retired, use the hyphenated twin instead-refresh-old-filesโ the hyphenated version of-refresh, same energy, same behaviour (see right below ๐)-refreshโ do NOT create new files, okay? Only files that already exist can get overwritten from the tarfile, and only if the archive has a newer version or if you're using the-Uflag. This lets you overwrite stuff with more recent files from an archive that contains more files than the target directory should hold. The option-refresh-old-filesis literally the same as-refresh. ๐-remove_firstโ obsoleted by-remove-first(hyphens, babe)-remove-firstโ remove files before extraction. When this is in effect, star removes files before extracting a file from the archive. You need this if you wanna change the file type or if you gotta break a hard link. ๐ซถ But heads up: if you don't pair it with either-ask-removeor-force-remove, this option is useless and no files will be removed. So basically it's giving nothing on its own. ๐ญ-remove_recursiveโ obsoleted by-remove-recursive-remove-recursiveโ remove files recursively. If removing a file is permitted, star will only remove files, specials and empty directories. With this option in effect, star is allowed to recursively remove non-empty directories too. ๐ธ-restoreโ flips star into true incremental restore mode. A file namedstar-symtableand a directory namedstar-tmpdirget created in the root directory of the file system where the extraction takes place. If-restorehas been specified, star behaves as if-xdothas been specified too. See also thelevel=option and the section INCREMENTAL BACKUPS for more. ๐
Note: do not use -restore if you only want to restore a single file or a list of selected files. That's not what it's for, bestie. ๐
rmt=pathโ specify the path to the program at the remote tape server for the RMT protocol. star by default calls the UNIX default path/etc/rmt. Since most rmt implementations cause problems when the server and client are on different OSes, it's recommended to tell star to call the rmt program that comes with star (/opt/schily/sbin/rmt). โจrsh=pathโ specify the program to log into the remote tape server for the RMT protocol. If the argument is the empty string, connections are made viarcmd(3). The default method to log into the remote server is configurable at compile time. The current default is set up to use ssh. ๐ฅ-Sโ do not store/create special files. A special file is any file except plain files, symbolic links and directories. You need to be super user to extract special files. ๐-s replstrโ modify file or archive member names named by a pattern according to the substitution expression replstr. The format of replstr is:
-s /old/new/[gp]
The old pattern may use regular expressions and the new string may contain the special character &. That & gets substituted by the string that matches the old pattern. The optional trailing g means global substitution. If g isn't used, a substitution pattern is only used once on a name. If the optional trailing p is used, the substitution is printed to standard error. ๐
Up to 100 substitute options may be used. If more than one substitute option has been specified, star loops over all substitute patterns until one matches. Those up to 100 substitute options are processed together with the -pax-s replstr options in the order they appear on the command line. If the name substitutes to the empty string, the file is skipped. ๐ฆ
-secure-linksโ do not extract hard links or symbolic links if the target of the link starts with a slash (/) or if/../is contained in the link target. Tar archives containing such links could be used to compromise the system. If they're unpacked together with a lot of other files, this may not even be noticed. ๐ณ
Links that don't point outside the tree that starts with the current working directory are not seen as a security risk. This makes star easy to use. It is always safe to unpack an unknown archive in an empty directory. ๐ซถ
Many system installations contain plenty of symbolic links with absolute path names or with /../ inside. The usability of a tar archiver for system backups and in copy mode would be limited if -secure-links checking were done by default for backups or when in copy mode, so star makes link checking optional when in -restore or in -copy mode. When neither -restore nor -copy has been specified, link checking is the default, since this is the usual way when archives from unknown sources are going to be unpacked. ๐
To turn off this default for the usual case, the option -no-secure-links may be used, and in -restore or -copy mode, -secure-links may be specified to turn it on.
If you unpacked a tar archive while -secure-links is effective and didn't get a security warning at the end of the star run, all files and links have been extracted. If you do get a warning, you should unpack the archive a second time and specify the options -k, -w and -nowarn in addition to the options used for the first run. To speed this up, it helps to use:
star -xvpw -find -type l
See the section SECURITY NOTES for more information and STAR_SECURE_LINKS in ENVIRONMENT and /etc/default/star for ways to configure the default behavior. โญ
-shmโ use System V shared memory for fifo. Normally star is compiled to use mapped/dev/zeropages for the fifo, if the operating system supports this. If star is compiled to have both code for mapped pages and for System V shared memory, star will use shared memory instead of the default. If the-helpmenu doesn't show the-shmflag, you have no choice. When using System V shared memory, you may have to raise the system's internal limit for shared memory resources to get enough shared memory for star. ๐-signed_checksumโ obsoleted by-signed-checksum-signed-checksumโ use signed chars to calculate checksums. This violates the tar specs, but old versions of tar derived from the seventh edition of UNIX are implemented in this way. ๐ซ Note: only filenames and linknames containing chars with the most significant bit set may trigger this problem, because all other fields only contain 7 bit ASCII characters, octal digits or binary zeroes. ๐-silentโ suppress informational messages likefoobar is sparse. ๐คซ-sparseโ handle files with holes effectively on store/create. Note that sparse files may not be archived this way if the archive format istar,ustar,suntar,pax, or any cpio variant. On Solaris-2.3 ... Solaris-2.5.1 there is a specialioctl()called_FIOAIthat allows root to get the allocation info more efficiently. On Solaris 11 there is an enhancedlseek(2)call with additional whence valuesSEEK_HOLEandSEEK_DATAthat allow finding holes in an efficient way. Other operating systems lack support to get the real allocation list and force star to scan the files to look for blocks that only contain null characters. This may cause star to assume more holes to be present than the number that the file really contains. ๐ณ๏ธ-symlinksโ this option tells star, in extract mode, to try to create a symlink whenever a hardlink is encountered in the archive. ๐-Tโ if the optionfile=orf=is omitted and the-Toption is present, star will use the device indicated by theTAPEenvironment variable, if set. ๐ผtardumps=nameโ set the file name for the tar dump dates database to name. The default name is/etc/tardumps. Use in combination with thelevel=option to create true incremental dumps. See also the-wtardumpsoption and the section INCREMENTAL BACKUPS for more information. ๐๏ธ-timeโ print timing info. See DIAGNOSTICS for more information. โฑ๏ธ-to_stdoutโ obsoleted by-to-stdout-to-stdoutโ extract files to stdout. This option may be used to extract tarfiles containing tarfiles (see examples below). ๐-tpathโ use this option together with the-toption or with-cv(verbose create) to get only a list of the pathnames of the files in the archive. This may be used in shell scripts to generate a name list. If used together with the-diffoption, star will only print the names of the files that differ. A second run of star may then be used to restore all files that had differences to the archive. Use thelist=option to specify the namelist in this case. ๐tsize=#โ set tape volume size to # to enable multi volume tape support. The value refers to the archive size without compression. Seebs=for the possible syntax. By default, the number is multiplied by512, so the value counts in units of 512 byte blocks. If the size specifier ends with a valid multiplication character (e.g..for bytes orMfor MB) the specified size is used as specified and not multiplied by 512. With this option in effect, star is able to archive filesystems that are bigger than the tape size. If the optiontsize=#is used without-multivol, then no file will be split across volumes and each volume may in theory be read back separately. Files that do not fit on a single tape may not be stored in this mode. If-multivolhas been specified in addition, star will split files when the maximum allowed tape size has been reached. If the tape volume size is not a multiple of the tape block size, the tape volume size is silently rounded down to a value that is a multiple of the tape block size. ๐๏ธ
See the -multivol option for more information.
-Uโ restore files unconditionally. By default, an older file from the archive will not replace a corresponding newer file on disk. ๐ฅumask=maskโ set star's umask to mask. This allows you to control the permissions for intermediate directories that are created by star in extract mode. See also the-poption. ๐
-uncond-renameโ bestie, this one is so extra on purpose. When you're in interactive restore mode, or whenever the-soption was specified, it will unconditionally ask you for a new name or apply a substitution. Like, even if the current path name would normally get skipped anyway โ because the file in the archive isn't newer than the file with the original name already sitting on disk โ nope, it still asks. No skipping, no silence, we're renaming. ๐-vโ bumps the verbose level up by one. More-v= more talking. โจ (Also peep the description for the-tflag.) Normallystardoes its work silently, like a lil ghost ๐ป. But if the verbose level is 2 or more andstaris in create or update mode, it will spit out a listing in the format of thels -loutput. Slay.-V,-notโ inverts the meaning of the pattern list, i.e. use the files that do not match any of the patterns. ๐ Heads up though: this only applies to patterns specified via thepattern=patternorpat=patternoption. Patterns specified as file type arguments are not affected. Read that twice, bestie.-versionโ prints version info and dips out. ๐ซถVOLHDR=nameโ use name to generate a volume header. That's it, that's the whole vibe. ๐ผ-wโ does interactive creation, extraction, or renaming. For every file that matches the list of patterns and that has a more recent modification time in the tar archive (if in extract mode and the-Uoption is not specified),starprints the name and asks:
get/put ? Y(es)/N(o)/C(hange name) :
You can answer either N for No, or just hit <Return> to skip the file. If you answer Y, the file gets extracted or archived on tape with its original name. If you answer C, you get prompted for a new name โ and that name is used for the filename on disk if star is in extract mode, or for the archive name if star is in create mode. ๐
See SECURITY NOTES for more info.
Note that-wis an interactive option that preventsstarfrom being used in non-interactive environments. Like, it literally can't do the thing without you there. ๐ญ
-wreadyโ tells Star to wait up to two minutes for the drive to become ready. This was added as a lil hack for a bug in the SunOS/Solarisstdevice driver. ๐ That driver has problems sensing the loading time with Exabyte drives on factory settings. It also makes sense to use-wreadyif multiple remote backups are made โ in that case, the remote connection is closed while the remote tape server is still writing a file mark. If another remote backup gets initiated before the old remote server finished writing that file mark, it would be impossible to open the tape driver unless-wreadyis specified to tellstarto wait for the drive to become ready again. ๐-wtardumpsโ tellsstarto update the file that contains the tar dump dates data base, if it's in dump mode. But โ plot twist โ if the dump is not a full dump, that tar dump dates data base file is not</> written. See alsotardumps=nameand the-Coption, or the INCREMENTAL BACKUPS section for the full tea. โ-X filenameโ use the file filename as a file containing a list of path names to be excluded from the store/create/list/diff operation. That filename file must contain a list of path names, each on its own separate line. โ ๏ธ Be careful with white space, and note that path names in the list may not contain new lines. You can use multiple-Xoptions โ each argument must refer to a file containing path names. The-Xoption has precedence before other options that select files to be included in the operation. See also thelist=option. ๐ซ๐-xattrโ reserved for NFSv4 extended attributes. That's the whole description, it's just holding a seat. ๐บ-xattr-linuxโ stores and extracts extended file attributes as found on Linux systems. This only makes sense when creating or extractingexustararchives, since it's based on POSIX.1-2001 extended tar headers. ๐ง
The method used in the current implementation could be used to store and extract extended file attributes from BSD too. Note though that the current implementation is not generic enough to cover more general extended file attribute implementations as found on Solaris. If star starts to implement a method that covers extended file attributes on Solaris, that new method will be used when -xattr has been specified, and -xattr-linux will then refer to the old method. And honestly? The method used with -xattr-linux may go away in the future. It's giving deprecated-adjacent, bestie. ๐
-xcopyโ an alias for-copy -sparse -acl. Combo deal, no cap. โจxdebug=#,xd=#โ set the extended debug level to #. Numbers go brrr. ๐-xdev,-Mโ do not descend mount points. Super useful when you're doing backups of complete file systems. See NOTES for more info. ๐๏ธ
When using -find, this may not always work as expected, e.g. when the /proc filesystem is involved. For this reason, use -xdev past -find. Got it? -xdev after -find. ๐
-xdirโ extract directories even if the corresponding directories on the archive are not newer. Useful when, for some reason, the directories are recorded after their content (see the-dirmodeoption), or when the permissions of some directories must be set in any case. Here's why: the classical UNIXcpioprogram does not implement delayed directory permission and time stamp setting, socpiousers often create archives in reverse order (directories past their content). For this reason, it makes sense to use-xdirwhile extractingcpioarchives. ๐โจ-xdotโ unconditionally extract the first directory in the archive if the name of this directory is either.or./. This helps extract archives in an expected way if the target directory is a newly created empty directory. Why does it matter? Because this directory is newer than the top level directory in the archive, sostarwould usually skip it during extraction. The effect of this directory is as if-xdirhas been specified, but it's switched off after the first directory has been found. One and done. ๐ฏ-xfflagsโ store and extract extended file flags as found on BSD and Linux systems. Only makes sense when creating or extractingexustararchives, since it's based on POSIX.1-2001 extended tar headers. See the NOTES section for problems with-xfflagson Linux systems. โ ๏ธ-xmetaโ extract meta files as if they were files. Meta files in archives are plain files that do not contain any content data in the archive. They may be created by using the-metaoption instar's create mode. Existing files are not overwritten. If a file is missing, a zero sized file is created. And if the option-metais used together with the option-force-hole, missing plain files are created as sparse empty files of the original size. ๐ณ๏ธ-xzโ run the input or output through axzpipe. See the COMPRESSION section for details. ๐๏ธ-Zโ run the input or output through acompresspipe. See the COMPRESSION section for details. ๐๏ธ-zโ run the input or output through agzippipe. See the COMPRESSION section for details. ๐๏ธ-zstdโ run the input or output through azstdpipe. See the COMPRESSION section for details. ๐๏ธ
โจ COMPRESSION โจ
Okay bestie, this section is where the glow-up happens. ๐
In most cases, star automatically detects compressed archives and executes an appropriate decompression program to help it extract files from the archive. The compressed archive is first passed to standard input of the decompression program. star then reads the decompressed archive from standard output of the decompression program and processes it as usual. It's a whole relay race. ๐โ๏ธ๐จ
If you want to create a compressed archive, or if this mechanism fails, the option compress-program=name can be used to configure name as a compression/decompression helper. The options -7z, -bz, -freeze, -j, -lzip, -lzma, -lzo, -xz, -Z, -z, and -zstd are available as shorthands for the most common compression/decompression helpers. For all of these helpers, star is capable of detecting that a compressed file needs one of them to be decompressed automatically. Iconic behaviour honestly. ๐
Compression and decompression helpers are expected to be filters reading from standard input and writing to standard output. By default, star passes the sole option -d to a decompression helper. Compression helpers are started without any options. Helper commands and options can be overridden using the name_CMD options in sections [compress] and [decompress] of /etc/default/star. See the FILES section for details. ๐
If the environment variable STAR_COMPRESS_FLAG is set, its contents are appended to the argument list for compression helpers. This is useful to pass a compression level to programs like gzip(1). ๐๏ธ
โจ INCREMENTAL BACKUPS โจ
okay so this is the big one ๐ Star can back up a file system in full mode and in incremental mode, bestie. But โ and this is the catch โ for incremental backups to even be a thing, the file system has to implement POSIX semantics. No POSIX, no slay. ๐ซถ
Let me be more verbose about that, because it matters:
- The filesystem needs to uniquely identify files by the two numbers
st_dev(the filesystem ID or device ID of the device containing the file) andst_ino(the file serial number). If a file gets renamed, these numbers need to be retained. Both numbers need to be a cardinal scalar that is expressible in a decimal number. ๐ข - The filesystem needs to implement at least two time stamps:
st_mtime, the file's last modification time, andst_ctime, the file's last status change time. Both time stamps need to be dealt with as documented by the POSIX standard. Both numbers need to be a cardinal scalar expressible in a decimal number, or as a decimal number counting in seconds plus another number counting in fractions of a second. โฐ - The filesystem needs to allow renaming files and directories by either calling
rename(2), orlink(2)andunlink(2). ๐ - The filesystem needs to honor and preserve the case of file names. ๐
The incremental backup method Star uses depends on comparing the time stamps of all files against the time of the last backup. Lowkey important: this method only works correctly if the level 0 backup and all higher level incrementals include the whole file system. Since Star archives all inode meta data, it's able to detect renamed files by comparing the inode numbers of all files while in incremental restore mode. ๐
Detecting renamed files only works if Star, while in backup mode, scans the whole file system tree for each full and incremental backup. This works in case no files are excluded and the dump starts at the root directory of a file system. In case no files are renamed from excluded parts to included parts, partial backups may be taken also. Partial backups only make sense if a complete directory sub tree is excluded (e.g. by using the pat= option) or if a partial backup starts at a sub directory that is not the root directory of the file system.
In case of a partial backup, it's important that no file or directory will ever be moved outside the scope and later move into the scope again. Moving files or directories outside the scope of a partial backup is detected as a deletion, and moving the files back into the scope does not make them appear in an incremental backup, since the time stamps of files from inside renamed directories did not change. ๐
Note that a backup must not include files that are mounted from another filesystem, and a restore cannot be done with more than one filesystem as target.
Files in the backup tree that are hidden under a mount point cannot be part of the backup as long as the backup is not done from a snapshot. ๐
To create a level 0 dump, call:
star -c -xdev -sparse -acl -link-dirs level=0 -wtardumps \
f=archive-name -C /filestem-mount-point .
To create a level 1 dump, call:
star -c -xdev -sparse -acl -link-dirs level=1 -wtardumps \
f=archive-name -C /filestem-mount-point .
Do not forget the dot at the end of the command line that specifies the directory to start the operation. It's literally right there, bestie, and the command will not do the thing without it. ๐
Backups from live filesystems should be avoided. On operating systems that support file system snapshots, backups should be made from a read-only mount of a snapshot. Be careful: all files that have been created between setting up a snapshot and starting an incremental backup may be missing from all backups unless the dumpdate=name option is used. ๐ญ
If the system that's going to be backed up is not acting as a file server, it makes sense to shut down all services that may result in inconsistent file states before setting up the filesystem snapshot. After the filesystem snapshot has been set up, the services may be restarted. โจ
If the system that's going to be backed up is acting as a file server, it may be that services on remote clients cause inconsistent file states unless all such services that remotely access files are shut down before the snapshot is set up. ๐ธ
Star includes options that help to deal with file system snapshots. The following example backs up a file system on Solaris using a file system snapshot from UFS:
echo > /tmp/snapstamp
mount -r `fssnap -F ufs -o \
backing-store=/var/tmp/EXPORT-NFS.snap /export/nfs` /mnt
star -c -xdev -sparse -acl -link-dirs level=0 -wtardumps \
f=archive-name dumpdate=/tmp/snapstamp \
fs-name=/export/nfs -C /mnt .
First a file with a current time stamp is created, then a snapshot for /export/nfs is created and mounted on /mnt. The following star command then creates a level 0 backup from the file system using the time the snapshot was created and the original mount point of the file system for /etc/tardumps and the archive header. ๐
Note that if the backup is done on a live file system, it may be unreliable. A typical problem problem in this context is caused by growing log files. As growing files are not a real problem with backups, the best way of dealing with growing files is to set up a star error control file (see the errctl= option) and to tell star to ignore growing files.
๐๏ธ BACKUP SCHEDULES ๐๏ธ
Full (level 0) dumps should be made on a regular base (e.g. once a month). As a full dump may take a long time and takes a lot of tape, it's wise to make higher level incremental dumps with shorter intervals. The next table shows a dump level list that may be used if monthly full dumps take place:
Sun Mon Tue Wed Thu Fri
Week 1: 0 10 10 10 10 5
Week 2: 10 10 10 10 10 5
Week 3: 10 10 10 10 10 5
Week 4: 10 10 10 10 10 5
The level 10 dumps made between Monday and Friday accumulate all changes made within the week, but you only need to restore the latest level 10 dump in order to get all changes back. If you don't like the size of the accumulated changes, use the following backup schedule:
Sun Mon Tue Wed Thu Fri
Week 1: 0 20 30 40 50 5
Week 2: 10 20 30 40 50 5
Week 3: 10 20 30 40 50 5
Week 4: 10 20 30 40 50 5
Note that in this case, 7 dumps need to be restored if the crash happens at the worst case date (just before the Friday dump in week 2 or later). ๐
๐ INCREMENTAL RESTORES ๐
Incremental restores should be made to an empty file system (except for the lost+found directory). Star is currently unable to perform incremental restores to a file system that contains active mount points.
Incremental restores should be run as root user. Star supports private incremental dumps and restores run as an unprivileged user, but this mode has been tested less frequently. ๐
The incremental restore procedure starts with restoring the last full (level 0) dump. Then the latest incremental dump of each dump level (with ascending order of dump levels) need to be restored.
Let us assume the first example from the section BACKUP SCHEDULES for the backup schedule. If a disk crash happens before the Thursday dump of week 3 has been made, the following restore procedure needs to be applied:
- level 0 โ starting with an empty disk, the full (level 0) dump from week 1 is restored. ๐
- level 5 โ after the level 0 restore has been finished, the level 5 dump from Friday in week 2 is restored. โจ
- level 10 โ after the level 5 restore has been finished, the level 10 dump from Wednesday in week 3 is restored. ๐
The disk now contains the same files as it did when the level 10 dump has been made on Wednesday of week 3. slay ๐ซถ
To extract a level 0 dump, call:
cd /extract-filestem-mount-point
star -xpU -restore f=archive-name
This creates the directory star-tmpdir and the database star-symtable in the root directory of the new file system. Subsequent restores with higher level backups depend on these files. ๐ฅ
To extract a level 1 (or higher) dump, call:
cd /extract-filestem-mount-point
star -xpU -restore f=archive-name
In order to restore a partial dump, the -partial option needs to be specified. This is to make sure that the user understands that renames to a path outside the scope of the partial dump may result in inconsistencies during a restore. โ ๏ธ
In case there is a dump level mismatch or a reference date mismatch, it's possible to give a restore a chance by specifying the -force-restore option.
Note that the environment variableSTAR_DEBUGexists;stardoes not remove files with link count 1 that have been removed between incremental dumps. These files are moved to the directorystar-tmpdir. Before you start to extract the next incremental, you need to remove all files instar-tmpdir. ๐งน
๐ฆ SYNCHRONIZING FILESYSTEMS ๐ฆ
Star may be used to synchronize filesystem content. To do this, an initial copy of the current content of the source filesystem needs to be performed first.
To create an initial copy of a filesystem, call:
star -c -xdev -sparse -acl -link-dirs level=0 -wtardumps \
-C /filestem-mount-point . | \
star -xpU -restore -C /extract-target-dir
In order to perform subsequent synchronization of the target filesystem with the content of the source filesystem, a modified incremental dump/restore procedure may be used.
To copy incremental content of a filesystem, call:
star -c -xdev -sparse -acl -link-dirs level=1 -wtardumps \
-cumulative -C /filestem-mount-point . | \
star -xpU -restore -C /extract-target-dir
Note that like with backups in general, copies from a live filesystem should be avoided. On operating systems that support file system snapshots, copies should be made from a read-only mount of a snapshot. Be careful: all files that have been created between setting up a snapshot and starting an incremental copy may be missing from all copies unless the dumpdate=name option is used. ๐ญ
See section INCREMENTAL BACKUPS to learn how to modify the command line in case file system snapshots are used. ๐
๐ธ SIGNALS ๐ธ
Okay bestie, so if star catches a signal, the very first thing it does is print the statistics. Periodt. Here's the tea on which signals it handles:
SIGINTโ usually generated by^Cfrom the controlling tty. Upon receipt of aSIGINT, star prints statistics and exits. But here's the cute part: if it's in create mode, i.e. storing files to archive, star finishes with the current file to ensure that no partial file is written to the archive, writes an eof record and then exits. No half-finished files on the archive, we don't do that here ๐SIGHUPโ this one is not to be generated from a tty. The actions are the same as upon receipt of aSIGINT.SIGQUIT,SIGINFOโ usually generated by^\from the controlling tty. Upon receipt of aSIGQUIT, star prints statistics and continues with the current operation. This is useful to watch the progress of the current operation. It's giving "check in on me but don't interrupt my flow" energy ๐ซถ
โจ EXIT STATUS โจ
The following exit values are returned. And ngl, there's a lil lore here: note that the negative values are only available to modern shells and programs that use waitid(2) on a POSIX OS and thus can retrieve the full 32 bits of the star exit code. The positive number variants are what you get when only the low 8 bits from the exit code are available. Slay.
0โ All files were processed successfully. The dream. The fantasy. ๐-64/192โ An exit code has been used that does not fit into an 8-bit unsigned number and the environmentCOMERR_EXCODEhas not been set. The value-64/192in this case marks a clash. Awkward.-4/252โ Star has been interrupted in create mode and the end of star has been delayed until the current file has been archived completely. This error is only used in case that no other error occurred and the tar archive only has become shorter than expected. Not the vibe, but it's honest work.-3/253โ Star has been called with the option-e, or theerrctl=option has been used to mark the current error fatal. You asked for this one bestie ๐ญ-2/254โ One or more files could not be processed successfully.-1/255โ Command line parsing error. The command line said something unhinged and star said no. ๐>0โ Other positive exit codes: Theerrnoof the call that caused the fatal error.
๐ EXAMPLES ๐
Real talk, this is the section where it all clicks. Let's go, iykyk.
To get a listing in a way similar to ls -l one might use:
example% star -tv f=/dev/rmt/1bn
The same command as listed above in a POSIX tar command line syntax compliant way is:
example% star tvf /dev/rmt/1mbn
To copy the directory tree in /home/someuser to the directory /home/fs use:
example% (cd /home/someuser; star -c .) | (cd /home/fs ; star -xp)
or by using the change directory option of star:
example% star -c -C /home/someuser . | star -xp -C /home/fs
Note that both examples above are not the optimum way to copy a directory tree. A more efficient way to copy a directory tree is to use the -copy option. Okay queen, level up ๐
example% star -copy -p -xdot -C /home/someuser . /home/fs
To copy a file tree including the Access Control List entries for all files and to correctly copy sparse (holey) files use:
example% star -copy -p -xdot -acl -sparse -C /home/someuser . /home/fs
To compare the content of a tape to the filesystem one might use:
example% star -diff -v f=/dev/rmt/1bn
To compare two directory trees one might use:
example% star -c . | star -C todir -diff -v diffopts=!times
or better by using a method similar to the -copy method above:
example% star -c -diff -v diffopts=!times -C fromdir . todir
To compare all properties of two file trees, use:
example% star -c -diff -vv -dump -acl -sparse -C fromdir . todir
To extract a backup of the /usr tree without all files residing below /usr/openwin one might use:
example% star -xp -V pat=openwin/\* f=/dev/rmt/1bn
To extract all .c files to src, all .o files to obj and all other files to /tmp one might use:
example% star -xp -C src '*.c' -C obj '*.o' -C /tmp '*' f=/dev/rmt/1bn
To extract files from a zipped tar archive that is located on a read only filesystem e.g. a CD while having the shell's working directory on the CD one might use:
example% star -zxp -C /tmp f=star-1.1.tar.gz
to extract the files from the tar archive to the /tmp directory.
To backup a list of files generated by the find(1) command:
example% find . find_options -print | star -c list=- f=/dev/rmt/1bn
Note that this does not work if the file names from output of the find command include new line characters. Yeah, newlines will absolutely wreck this, no cap ๐ฌ
To extract a tarfile that contains a tarfile one might use:
example% star -x -to-stdout f=/dev/rmt/1bn pat=pat | star -xp
Pat, in this case should match the tarfile in the tarfile on tape that should be extracted. Tarception fr fr ๐
To make a backup of the root filesystem to a tape drive connected to a remote machine, one might use:
example# cd /
example# star -cM fs=128m bs=63k f=tape@remotehost:/dev/rmt/1bn .
You need a line in /etc/passwd like the following to enable this:
tape:NP:60001:60001:Tape:/etc/tapehome:/opt/schily/sbin/rmt
And a .rhosts file in /etc/tapehome to allow remote connections from the appropriate hosts. Make sure that the file /etc/default/rmt exists and allows remote access to the requested tape drive.
To use a faster rcmd(3) connection for a backup to a remote tape server, one might use:
example# env RSH='' star -cM fs=128m bs=63k
f=tape@remotehost:/dev/rmt/1bn .
Note that this requires root privileges. Main character energy only ๐ฅ
To repair a corrupted filesystem for which no recent backup exists, do the following:
example# fsck -y /filesys
example# mount /filesys
example# cd /filesys
example# star -xpk f=/dev/rmt/1bn
example# mt -f /dev/rmt/1bn rewind
example# star -diff -v diffopts=!times f=/dev/rmt/1bn
Now check the differences and decide whether to restore additional files. This may be done by generating a list containing the needed filenames and using the list= option or by using the interactive mode (see -w option).
If you want a list that only contains all filenames from files with differences you may use:
example# star -diff -tpath diffopts=!times f=/dev/rmt/1bn
If you are looking for files that changed the type or the access permission because this is a common case on still corrupted files, use:
example# star -diff -tpath diffopts=type,perm f=/dev/rmt/1bn
If you like to archive all directories only that are part of the directory tree under ".", use:
example# star -c f=archive-name -find . -type d
If you like to archive all files as owner root and group root and make all files world readable in the archive, use:
example# star -c f=archive-name -find . -chown root -chgrp root
-chmod o+r
If you like to archive all files with a mtime of now, use:
example# star -c f=archive-name -find . -chmtime now
If you like to list all files in an archive in a way like sfind(1), instead of the way used by star, use:
example# star -t f=archive-name -find . -ls -false
If you like to split the content of an archived tree into tar chunks of 1 GB, you could call:
example# star -c f=/tmp/v.tar tsize=1G \
new-volume-script='sh -c "mv /tmp/v.tar /tmp/v$(($1-1)).tar" nv' .
โจ iconic behaviour, truly โจ
โจ ENVIRONMENT โจ
okay bestie, this is the part where star checks out the ~vibes~ of your environment before it does literally anything. these are the little variables that change how star behaves by default, and some of them are lowkey iconic and some are highkey "read this twice". let's go ๐
COMERR_EXCODEโ if this one's present, exit codes are not mapped, which dodges possible clashes with calling programs that use the outdatedwaitpid(2)instead of thewaitid(2)call to wait for the exit status from star. and why does that matter? becausewaitid(2)hands you the full 32 bit exit code, whilewaitpid(2)masks the exit code with0377๐ญ. withoutCOMERR_EXCODEset, exit codes outside the range-63 .. 191get mapped to-64(192) to mark a clash.
and there's a lil plot twist: if COMERR_EXCODE is set and the value starts with the character '0', then an exitcode code > 0 that leads to exitcode & 0377 == 0 is mapped to -64, just to avoid confusion with shells that use waitid(2) but interpret these exit codes as zero with respect to conditional execution, all in the name of implementing compatibility to historical shells.
so if you're running a shell that supports the full exitcode and a POSIX compliant operating system? setting COMERR_EXCODE is the recommended move, periodt.
STAR_COMPRESS_FLAGโ if you're the type of girl who wants star to always create compressed files that use maximum compression, just set this environment variable to-9and never think about it again ๐.STAR_DEBUGโ if this environment variable is present, star will not remove temporary files from./star-tmpdir. the files in this directory are files that have been removed by users before the last incremental dump did take place on the master filesystem. forensic queen behavior ๐.STAR_FIFOSIZEโ if you like to by default let star use a different fifo size, set this environment variable to the desired size. that's it, that's the whole vibe.STAR_FSYNCโ set it toN'and the default behavior of star is as if the-no-fsyncoption has always been specified.
this grants that star is always faster than other archivers, but it makes it impossible for star to check whether the extraction of a file to the filesystem was successful. speed vs. certainty, bestie, you gotta pick ๐ฌ.
if set to any other value, the default behavior of star is as if the -do-fsync option has always been specified.
STAR_FSYNC has precedence over /etc/default/star, but it may still be overwritten by command line options. the command line is always the main character ๐.
STAR_NOHINTโ if this environment is seen, some informative messages are not printed. this currently applies to messages related toSTAR_FSYNCandSTAR_SECURE_LINKS. sometimes you just want the quiet life ๐คซ.STAR_SECURE_LINKSโ set it toN'and the default behavior of star is as if the-no-secure-linksoption has always been specified. this disables checks for potentially insecure links by default.
if you like to make this the default, keep in mind that you need to specify -secure-links in case you like to unpack an archive from unknown sources. unknown sources = turn the safety back ON, bestie, i am begging ๐.
STAR_SECURE_LINKS has precedence over /etc/default/star, but it may still be overwritten by command line options.
STAR_WORKAROUNDSโ if this environment variable is present, implement workarounds for named problems. the environment variable is expected to contain a comma separated list of bug names:ssh-tcpipโ implement a workaround for a bug caused by ssh or TCP-IP seen on Linux in 2003. the bug caused the verbose output from star onstderrto be lost when calling something like:
ssh host 'star -c ...'
the workaround is activated when stderr is not connected to a terminal, and it works by waiting for 0.1 seconds for the output to appear. a whole 0.1 seconds of patience, the sacrifice we make for history ๐ฐ๏ธ.
TAPEโ unlike othertar(1)implementations, star defaults to usestdin/stdoutfor the archive. so if you like star to use the file name from theTAPEenvironment instead, you need to specify the-Toption too. yes, both. no shortcuts ๐.RSHโ if theRSHenvironment is present, the remote connection will not be created via the default method, but rather uses the program specified byRSH. use e.g.RSH=/path/to/sshto create a secure shell connection using a specific ssh version.
if the RSH environment is not present, the compiled in default is used. this currently is ssh.
if the RSH environment is empty, then rcmd(3) is used.
former versions of star by default did use rcmd(3) to create a remote connection. using a different method forces star to create a pipe to the rsh(1) or ssh (1) program and disallows star to directly access the network socket to the remote server. this makes it impossible to work at maximum performance and slows down the connection compared to a root initiated rcmd(3) connection ๐.
see the rsh= option for more information.
see the BUGS section for more information.
RMTโ if theRMTenvironment is present, the remote tape server will not be the program/etc/rmtbut the program pointed to byRMT. note that the remote tape server program name will be ignored if you log in using an account that has been created with a remote tape server program as login shell. sneaky, i know ๐.
see the rmt= option for more information.
๐พ FILES ๐พ
ok so here's where star keeps all its little treasures. buckle up bestie, there's a whole lore drop here ๐ซถ
/etc/default/star
this is the vibes file. you can set default values for the following options in /etc/default/star. for example:
CDR_FIFOSIZE=64m
STAR_FIFOSIZE
sets the default size of the FIFO (peep the fs=# option too, iykyk).
STAR_FIFOSIZE_MAX
sets the maximum size of the FIFO (also see fs=#). setting STAR_FIFOSIZE_MAX in /etc/default/star lets you overwrite global values from backup scripts on machines with less memory. so basically, tiny-RAM girlies stay winning ๐ง
STAR_FSYNC
if you set this to N, star's default behavior is as if the -no-fsync option had been specified the whole time.
this guarantees that star is always faster than other archivers โ but it also makes it impossible for star to check whether the extraction of a file to the filesystem was successful. ๐
this setting gets overwritten by the STAR_FSYNC environment variable, if that's present.
if you like making the default fast, keep in mind you need to specify -do-fsync for cases where star needs to be able to know whether the extraction was successful. no cap.
STAR_SECURE_LINKS
if you set this to N, star's default behavior is as if the -no-secure-links option had been specified all along.
this disables checks for potentially insecure links by default. ๐
this setting is overwritten by the STAR_SECURE_LINKS environment, if present.
if you like making this the default, remember you need to specify -secure-links in case you want to unpack an archive from unknown sources. safety first, periodt.
archive0=, archive1=, archive2=, archive3=, archive4=, archive5=, archive6=, archive7=
archive entries for the -[0..7] option. โจ
a correct archive?= line has 3..4 space separated entries:
- the first is the device entry (e.g.
archive0=/dev/tape) - the second is the blocking factor in 512 byte units
- the third is the maximum media size in 1024 byte units โ if this entry contains a
0, then the media size is unlimited - the fourth entry is optional. if it contains a
'n'or a'N', then the archive device is not a tape
examples, bestie:
archive0=/dev/tape 512 0 y
archive1=/dev/fd0 1 1440 n
archive2=/dev/rmt/0mbn 512 0
if the default file doesn't need to be shared with the tar program from Solaris, any number may be used like a generic size option like bs=.
example:
archive0=/dev/tape 256k 40G y
[compress], [decompress]
compression/decompression helpers, the little sidekicks ๐ฆ for each program passed via option compress-program=name, a helper can be defined with option name_CMD in the appropriate section. this helper is ran instead of name, permitting you to use a program with a different name or to pass different options from the defaults (see section COMPRESSION for details). this feature is currently not available on DOS (DJGPP).
the following example defines a compression/decompression helper for the PKZIP format, passing archives through zip(1) or unzip(1) as appropriate:
[compress]
ZIP_CMD=zip -9
[decompress]
ZIP_CMD=unzip
/etc/tardumps
the default name for the dump level archive. this default name is used whenever the tardumps=name option hasn't been specified. the file is written or updated when -wtardumps is used.
the file holds one or more lines, each specifying a dump level entry. each dump level entry starts with a mount point name followed by a TAB and one or more spaces, followed by the decimal dump level, a space and the dump time.
if the dump level is directly followed by a 'P', then the dump refers to a partial dump (a dump that does not include the whole filesystem).
the dump time itself includes:
- the decimal representation of the UTC seconds since Jan 01 1970
- a space
- the textual local time representation of the dump time
the numerical decimal dump time representation may be followed by a dot and a sub second value. the textual local time representation is for informational use by humans only and not evaluated by star. it's giving decorative fr fr ๐ธ
./star-symtable
contains a database that is needed in incremental restore mode. ๐
./star-symdump
contains an intermediate dump of restore database after a fatal error condition was met during an incremental restore operation. yeah... when things go wrong, this is the receipt ๐ญ
./star-tmpdir
is the temporary directory that is used as intermediate file storage by star if in incremental restore mode.
./star-lock
is a lock file created by star when doing an incremental restore. if this file is present, it prevents star from running another incremental restore operation. this helps to avoid more than one restore operation at a time (e.g. from a cron script). iconic gatekeeping behavior, honestly ๐
/dev/tty
is used for the interactive user interface. yes bestie, star talks back โจ
๐ SEE ALSO ๐
spax(1), scpio(1), tar(1), cpio(1), pax(1), rcp(1), mt(1), rmt(1), match(1), dd(1), sdd(1), rsh(1), ssh(1), star_sym(1), tartest(1), star(5), rcmd(3), fssnap(1m), waitid(2), waitpid(2)
go read the whole friend group, they're all valid ๐ซถ
๐ฉบ DIAGNOSTICS ๐ฉบ
star: f records + p bytes (total of x bytes = d.nnk).
the number of full records, the number of bytes in partial records, and the total amount of data in KBytes. the math is mathing ๐
star: Total time x.yyysec (z kBytes/sec)
the time used and the transfer speed from/to the archive. speed check complete, and she ate ๐ฅ
if there have been non fatal errors during the archive processing, star will display a delayed error summary before exiting. so like, don't just scroll past that part, bestie ๐ญ
๐ NOTES ๐
okay so bestie, here's the tea on how tar command lines work, because it's lowkey iconic and also highkey weird. The command line syntax for the tar command (as defined in SUSv2 - UNIX-98) deviates from the command line syntax defined for all other commands. While the POSIX command line syntax requests all options to start with a dash (-) and allows one to either write options separately or combined (in case of boolean flags), the tar command line syntax requires all options to be combined into a single string that does not start with a dash. Star by default assumes a command line syntax like a typical POSIX command and includes a compatibility mode that allows one to specify a command line syntax as documented for the UNIX-98 tar command. So if you think you found a bug in the way star parses the command line, please, please check your command line for correctness first before you make a bug report for star. ๐ซถ
If you like to write portable shell scripts that call tar, use the UNIX-98 tar command line syntax (i.e. a single option string and no dash), choose the commands and options from the following set of characters ( rxtuc vxfblmo ) and check the shell script with both, your local tar and star for correct behavior. If you expect the script to call gnutar, do not include the -o option as gnutar implements this option in a way that violates UNIX-98. ๐
Star strips leading ./ sequences from pathnames. This lets star in many cases store longer pathnames than other implementations. slay.
The POSIX.1-1988 method (ustar format) of storing files with pathnames that are longer than 100 chars has some limitations, and honestly it's giving "we ran out of room":
- The name field (100 chars) an inserted slash (
/) and the prefix field (155 chars) produce the pathname of the file. When recreating the original filename, name and prefix are concatenated, using a slash character in the middle. If a pathname does not fit in the space provided or may not be split at a slash character so that the parts will fit into 100 + 155 chars, the file may not be archived. Linknames longer than 100 chars may not be archived too. ๐
The star, xstar, xustar, exustar, pax, and gnutar archive formats don't have these limitations. While gnutar uses a method that makes it impossible for other tar implementations (except star) to restore filenames that are longer than 100 chars, the xstar, xustar, exustar and pax/epax archive format uses a method that allows an POSIX.1-1988 compliant way of storing filenames, if the POSIX method would allow this. When the archive format is xustar, exustar or pax/epax very long filenames are stored using extended headers from the POSIX.1-2001 standard. โจ
Some buggy tar implementations will generate incorrect filenames during a restore operation if the archive contains pathnames or linknames of exactly 100 chars length. not the vibes. ๐ญ
Star adds a tar signature in the last four bytes of each tar header if the archive format is star or xstar. This is no problem with the star archive format as it is an extension of the old pre POSIX.1-1988 tar format. On the other side, the xstar archive format claims to be as POSIX.1-1988 compliant as possible. Inserting this tar signature is a minor deviation from the standard that has the last 12 bytes of each header reserved for future use. On the other side, tar implementations such as some pax implementations that only compute checksums on the first 500 bytes of the header are violating the standard that requests the checksum to be computed on all 512 bytes of the tar header. All tar implementations that are 100% Posix compliant will be able to extract xstar archives as long as no new standard is defined that claims the last 12 bytes of the header for a different use. But then the ustar version number should be changed from 00 to 01. Now, that the POSIX-2001 standard has been accepted, it is even predictable that all extensions to the standard tar format will go into the POSIX.1-2001 extended headers which are extensible to include any feature without future limitation. The only known tar implementation that also uses the last 12 bytes of the tar header is Sun's tar which uses these 12 bytes for files that are split over several archives. Such archives created by Sun's tar are not readable by the buggy pax implementation too. The Sun extension is not incompatible to the star signature because Sun expects an octal number at the beginning of the 12 byte field which is a null character in the star case. ๐
Star uses these four bytes since 1985 without problems. If you need a 100% POSIX.1-1988 and 100% POSIX.1-2001 compliant tar archive, you may use the xustar, exustar or the pax/epax archive format. The probability of falsely detecting other tar formats as xustar or exustar format however is higher. iykyk.
There is no way to ask for the n-th occurrence of a file. periodt.
The way EOF is handled by star differs, whether the fifo is in effect or not. If the fifo is not used, star stops reading the archive if it encounters a logical EOF record in the archive. If the fifo is used, star may read until the fifo is full or until the real EOF mark on tape is reached. How much data star actually reads depends on the time when the star foreground process sends a fifo shutdown signal to the background fifo read process. ๐ฆ
Gnu tar often creates tar archives with incorrect logical EOF marks. The standard requires two blocks that are completely zeroed, whereas gnutar often only adds one of them. ๐
Old versions of tar found on SYSVr3 and earlier cannot read tar archives with a blocksize greater than 10 kBytes.
The method of storing sparse files currently used with the star and xstar format is not guaranteed to be used in later versions of star. If the author decides to change this method, later versions of star may not be able to restore sparse files from tar archives made by the current version of star. so like, just be aware bestie.
Some tar implementations violate the standard in using only the first 500 Bytes of the header for checksum computation. These tar implementations will not accept star and xstar type tar archives. their loss honestly. ๐
Sun's Solaris 2.x tar implementation violates the Posix standard. Tar archives generated by star cause Sun's tar to print tar: impossible file type messages. You may ignore these messages.
Gnutar's dumpdirs are non standard and are currently not implemented.
If gnutar archives sparse files with more than four holes, it produces archives that violate the standard in a way that prevents other tar implementations to read these archives. Star knows about that and is able to handle these gnutar archives. main character energy.
The filetype N (LF_NAMES) from gnutar (an obsolete method of storing long names) will never be implemented.
Note that on operating systems (like DOS) that do not implement real pipes, star implements compression via a temporary file. Using compression thus is limited by the maximum file size and the available disk space.
The extended file flags implementation (see -xfflags option) on Linux is buggy by design. In order to retrieve the needed information, every file needs to be opened. If the /dev directory is included in create mode, every possible driver will be loaded which may hang the system for a long time. In the worst case, unwanted side effects from opening devices (such as causing tape drives to rewind the media) may be caused. ๐ฌ
๐ SECURITY NOTES ๐
bestie, sit down for this one, it's important.
If you unpack a tar archive in a non empty directory, any file in that directory may be overwritten unless you specify the -k option. If the archive contains symbolic links or hard links, star may even overwrite files outside the current directory. If the directory where the archive is been unpacked is not empty and contains contains symbolic links or hard links to directories outside that directory, star may also overwrite files outside the current directory. As many other commands, star usually has all possible permissions when run as root. Unpacking archives as root thus may have fatal results to any file on your system. Be very careful when you try to extract an archive that has not been created by you. It is possible to create hand crafted tar archives that may overwrite critical files (like /etc/passwd) on your system. In addition all tar archives that have been created with the list= option and tar archives where the C= option was not specified before all file type arguments may be critical. ๐
A good advise is to extract all doubtful archives as non root in an empty directory and to neither specify the-/nor-..or-no-secure-linksoptions. If you get a warning, you should unpack the archive a second time and specify the options-k,-wand-nowarnin addition to the options used for the first run. ๐ซถ
See the ENVIRONMENT section and /etc/default/star for ways to configure the default behavior.
๐ SUID NOTES ๐
If star is installed suid root, star is able to make connections to remote archives for non root users. This is done by using the rcmd(3) interface to get a connection to a rmt(1) server. iconic.
Star resets its effective uid back to the real user id immediately after setting up the remote connection to the rmt server and before opening any other file. safety first, slay. โจ
If star has not been installed suid root and not called by root, it will try to create the remote connection via rsh(1) or ssh(1) (in case the environment RSH has been set to ssh). Note that in this case, the throughput to the remote tape server will be much lower than with a connection that has been initiated via rcmd(3). ๐ญ
๐ LIMITATIONS ๐
If star is running on a large file aware platform, star is able to handle files up to 8 GB in a mode that is compliant to the POSIX.1-1988 ustar format. With a nonstandard star specific extension, up to 95 bits may be used to code the filesize. This will handle files up to 200,000,000 TB. With the new POSIX.1-2001 extended headers used by the xustar, exustar and pax/epax format, any filesize may be archived. ๐ โจ
๐ BUGS ๐ (the messy part, no cap)
okay bestie, sit down, we gotta talk about the drama. ๐ญ
- the whole
-fsituation? the way it has to be implemented to stay compatible with old tar implementations gives us several problems, fr fr. the options-fifostats,-force-hole,-force-removeand-fifointerfere with the-foption, and the fact that they exist prevents users from using filenames like e.g.ifothe traditional way, where the filename directly follows the string-fwith no space between the option name and the file name. - but lowkey it's fine: there's no problem to use a file named
ifoby calling-f ifo,f=ifo,-f=ifoor-f= ifo. ๐ซถ
โ ๏ธ Be careful not to make typos with the above options. The result could be that a file is created as a result of the mistyped option. not a vibe, bestie. ๐
- There is currently no way to set the fifo lowwater and highwater marks. ๐
- If you ever discover a hang in the fifo of star, get the process ids for both star processes, send both a RTMAX signal using
kill(1)and report the diagnostic output. (yes really, both of them, we need the tea โ) - There is currently no way to automatically delete files in the target file tree if they are obsolete. Star should implement something similar to gnutar's dumpdirs. someday bestie, someday ๐
- If not invoked by the super user star may not be able to extract files if they reside in read only directories. ๐
- Star is not able to make a complete backup of a filesystem if files are hidden by a mount that is in effect on a directory of this filesystem. This may be avoided in case of the ufs filesystem if the backup is made off a ufs snapshot (see the man page for
fssnap(1m)). It could be avoided for any filesystem if the loopback filesystem had an option that tells lofs not to traverse mountpoints. ๐ฆ
๐จ the signal-handling hall of shame ๐จ
For now (late 2002), we know that the following programs are broken and do not implement signal handling correctly:
rshon SunOS-5.0...SunOS-5.9sshfrom ssh.comsshfrom openssh.org
Sun already did accept a bug report for rsh(1)/ssh(1). Openssh.org accepted and fixed a bug for their implementation of ssh(1). slay for the fix ๐
If you use star to create a remote connection via an unfixed rsh(1) or ssh(1), be prepared that terminal generated signals may interrupt the remote connection. ๐ญ consider this your warning, bestie.
okay and if you find MORE bugs (iconic of you honestly), or you just have suggestions:
Mail other bugs and suggestions to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues.
The mailing list archive may be found at:
https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists.in-berlin.de.
๐ HISTORY ๐ (the lore, the origin story, the multiverse timeline)
A tar command appeared in Seventh Edition Unix, which was released in January, 1979. It replaced the tp program from Fourth Edition Unix which replaced the tap program from First Edition Unix. the family tree is giving ancestry.com ๐ธ
Star was first created in 1982 to extract tapes on a UNIX clone (UNOS) that had no tar command. In 1985 the first fully functional version has been released as mtar. ๐
When the old star format extensions have been introduced in 1985, it was renamed to star (Schily tar). In 1994, Posix 1003.1-1988 extensions were added and star was renamed to star (Standard tar). the character development?? obsessed. โจ
๐ AUTHORS ๐
Joerg Schilling and the schilytools project authors. legends only, no notes ๐
๐ฆ SOURCE DOWNLOAD ๐ฆ
The source code for star is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at
https://codeberg.org/schilytools/schilytools.
The download directory is
https://codeberg.org/schilytools/schilytools/releases.
and that's a wrap bestie!! ๐ this whole thing is STAR(1) from the schilytools project, written by Joerg Schilling, and this version is dated 2023/01/11 โ so if you're reading this, congrats, you've reached the end of the manual. now go archive something. slay. ๐ โจ๐ฆ
๐ฆ where this page comes from
- fedora 44: star 2024.03.21-6.fc44 ยท CDDL-1.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND LicenseRef-Fedora-Public-Domain
- Copyright 1982-2020 J. Schilling
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms