STAR(1)

๐Ÿ“ฆ
version 2024.03.21 ยท 4 versions
, in fedora 44

โœจ 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 -fifo and fs= 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 -w flag it is easy to merge a tar archive into an existing file tree. See also -U option. In create mode use the pat= option to specify either select or exclude patterns (depending on the -V flag). In extract or list mode all file type arguments are interpreted as select patterns while the patterns specified with the pat= option may be used as select or exclude patterns (depending on the -V flag). Have a look at the description of the -C option 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 allows ed(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) and restore(1) that are known as ufsdump(1) and ufsrestore(1) on Solaris.
  • find-like function: Star includes an enhanced function that is similar to the find(1) command (see sfind(1)). This function is implemented in libfind. It allows one to use find expressions, even in extract or list mode, directly on the content on an archive. The extensions to find(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, atime and even ctime). 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=ustar option, or if called as ustar or tar while the H=headertype option is not used, star is 100% POSIX compliant.
  • default format: Star's default format (if called as star) is xstar and 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 than 100+130 chars or when archiving sparse files with the -sparse option in effect. All other files will extract correctly. See the description for the H=headertype option 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 -y has been run on the filesystem, star is able to restore only the missing files automatically. Use then star -diff to 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=headertype option 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 in suntar(1).
  • tar โ€” The classical tar interface selects the command line interface of the classical UNIX tar command. This is currently an alias to suntar and 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 in gnutar(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 original gtar(1) command.
  • pax โ€” The pax interface selects the command line interface of the POSIX pax command as described in spax(1).
  • cpio โ€” The cpio interface selects the command line interface of the classical UNIX cpio command as described in scpio(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 -v option 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 -cx instead of -copy is 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 than diff -r. And if you use star's dump extensions for the tar archive, the -diff option 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 -v options increases the verbosity. With -vv and above, the directory content is compared also if star is reading a tar archive that has been created in -dump mode โœจ
  • -n โ€” No extraction. Show what star would do, in case the -x command 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 -v flag is used, the listing is similar to the format of ls -l output. With this option, the flags -a, -atime and -ctime have a different meaning if the archive is in star, xstar, xustar, exustar, or pax/epax format. The option -a or -atime lists the access time instead of the modification time, and the option -ctime lists the file creation time instead of the modification time. The option -tpath may 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 -r and -u command 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 -U flag is not used, star extracts 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 for star(1).
  • -xhelp โ€” Print a summary of the less important options for star(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, star does 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, star by default does not extract files that contain /../ in the name, if star is not in interactive mode (see -w option).

See SECURITY NOTES for more information ๐Ÿšจ

  • -7z โ€” Run the input or output through a p7zip pipe. 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/tar in Solaris.
  • -acl โ€” Handle Access Control List (ACL) information in create and extract mode. If -acl has been specified, star is in create mode and the header type is exustar, star will add ACL information to the archive using POSIX.1-2001 extended headers. If -acl has been specified and star is in extract mode, star will try to restore ACL information. If there is no ACL information for one or all files in the archive, star will clear the ACL information for the specific file. Note that if -acl has not been specified, star will not handle ACL information at all, and files may inherit ACL information from the parent directories. And if the -acl option has been specified, star assumes that the -p option 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 in headertype format. If this option is used in extract/list mode, this forces star to interpret the headers to be of type headertype. And since star even 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 for headertype are:
    • 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 -d option 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 the asc cpio 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 the crc archive 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 default star will NOT overwrite files that are read only, no ma'am. But if this option is in effect, star will 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), star uses the _FIOSATIME ioctl to pull this off, which lets star reset the atime without trashing the ctime. ๐Ÿ’… If you use -atime together with the list command, star lists the access time instead of the modification time. (Heads up though โ€” that only works with the star, xstar, xustar, exustar formats, and with the pax/epax format.) 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 โ€” Force star to do multiple reads (if necessary) to fill a block. This option exists so star can work across the Ethernet, because pipes and sockets return partial blocks even when more data is coming. And if star uses stdin as the archive file, it behaves as if you called it with -B anyway โ€” which is literally why, in practice, you almost never need this option. ๐Ÿซถ
  • b=# โ€” Set the block size for tape operations. See the blocks=# 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-number are based on a block size of 512 bytes, and the tape block size is usually larger, so the tape block number for the mt fsr command 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 # times 512 bytes (unless you specified a different multiplication factor โ€” see the bs= 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 the f= option below). The default is a blocking factor of 20, i.e. 10 kBytes. 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 in dd(1) and sdd(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, or p, the size is multiplied by 1, 2, 512, 1024, 1024*1024, 1024*1024*1024, 1024*1024*1024*1024 or 1024*1024*1024*1024*1024 respectively. โœจ

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 the C= option to BSD style. The default behavior of star is to stay in a working directory until a new C= is seen. With BSD tar, the C= option is only related to the next file type argument. Different vibe, same letter.
  • -bz โ€” Run the input or output through a bzip2 pipe. This option is an alias for -j. See the section COMPRESSION for details. ๐Ÿฆ‹
  • C=dir
  • -C dir โ€” Perform a chdir(2) operation to dir before storing or extracting the next files. In all cases, star performs the chdir(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 -t flag), star ignores all -C options. Periodt.
    • In create mode (with the -c, -r and -u flag), star walks through all -C options and file type arguments. While a BSD derived tar(1) implementation goes back to the current working directory after storing one file argument that immediately follows the -C option, star only changes the directory if a new -C option follows. To emulate the behavior of a BSD derived tar(1), add a -C . option after the file argument. ๐Ÿซถ
    • In extract mode (with the -x, -n and -diff flag), star builds a pattern list together with corresponding directories from previous C=dir options and performs a chdir(2) to the corresponding directory of a matching pattern. All pat= options that do not follow a C=dir option are interpreted as if they were preceded by a -C . option. See EXAMPLES for more information. ๐ŸŒˆ
  • 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 call star twice, because star cannot 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 call star twice, because star cannot copy files that appear in the archive later than a symlink pointing to them. ๐Ÿ™ˆ
  • -cpio-statistics โ€” Instead of the star flavor of the statistics, print statistics in cpio flavor. Choose your aesthetic. ๐Ÿ’…
  • -ctime โ€” If used with the list command, this lists ctime rather than mtime if the archive format is star, xstar, xustar, exustar, or pax/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 like cron and the news system. Although star tries 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-cumulative for 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: -D is in effect by default if you're using the list=file option. But if you actually want star to descend into directories it finds in that list file? Use the -dodesc option (it's further down, keep scrolling ๐Ÿ’…).
  • -d โ€” do not store/create directories. Periodt. Here's the lore: old-school tar versions, 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 with tar implementations 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 an errctl= 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 using csh(1) you might have problems using ! because of its strange parser โ€” that's literally why the not alias exists. ๐Ÿซถ
    • perm โ€” compares file permissions. With this option in effect, star compares the low order 12 bits of the st_mode field.
    • mode โ€” same as perm.
    • 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 compares symperm only if perm is 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 in exustar format and contains star's dump extensions.
    • dnlink โ€” compares link count on hardlinks for directories. If comparing dnlink is excluded but nlink is 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 in exustar format 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 as data.
    • rdev โ€” compares major/minor numbers for device nodes.
    • hardlink โ€” compares target of hardlinks.
    • symlink โ€” compares target of symlinks. This evaluates the paths returned by the readlink(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 the readlink(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 is star, xstar, xustar, exustar, or gnutar.
  • atime โ€” compares access time of file. This only works if the archive format is star, xstar, xustar, exustar, or pax/epax.
  • mtime โ€” compares modification time of file.
  • ctime โ€” this only works if the archive format is star, xstar, xustar, exustar, or pax/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 compares lmtime only if mtime is 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 in exustar format 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 in exustar format and has been created with star's -acl option. You need to specify the -acl option in addition when running the diff.
  • xattr โ€” compares extended file attributes. This only works if the archive is in exustar format and has been created with star's -xattr option. You need to specify the -xattr option in addition when running the diff.
  • fflags โ€” compares extended file flags. This only works if the archive is in exustar format and has been created with star's -xfflags option. You need to specify the -xfflags option 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 -dirmode option 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 -U is used while extracting the archive. โœจ
  • -do-fsync โ€” tells star to call fsync(2) for every file when in extract mode. This lets star check whether a file could be successfully extracted. See -no-fsync for more information. ๐Ÿซก
  • -dodesc โ€” forces star to descend into directories it finds inside a list=file. Bestie, it's literally the same energy as -D up above, so peek at that one too. Heads up tho: -dodesc only 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 the level= 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 -dump but creates more global archive header meta data, e.g. the SCHILY.volhdr.hostname tag. Lowkey a glow-up.

This helps you understand where a tar archive has been created. ๐Ÿฆ‹

  • -dump-cumulative โ€” tells star to 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-cumulative is not used. See the section SYNCHRONIZING FILESYSTEMS for more info. ๐Ÿ“ˆ
  • dumpdate=name โ€” tells star to use the mtime of the time stamp file name instead of using the start time of star. This is needed when star is run on file system snapshots. If star used its own start time with snapshots, all files that have been modified between the setup of the snapshot and the start of star would 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 of star in incremental dump mode. If -dumpmeta is used and only the inode change time (st_ctime) of a file has been updated since the last incremental dump, star will archive only the meta data of the file (e.g. uid, permissions, ...) but not the file content. Using -dumpmeta results in smaller incremental dumps, but files that have been created between two incrementals and set to an old date in st_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 -e option 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= name
  • errctl= 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, star aborts (exits) as soon as possible after this error condition has been seen, instead of making star quiet 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, star prints the warning about the error condition, but the error condition does not affect the exit code of star and 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). The WARN meta condition has a lower precedence than ABORT.
  • DIFF โ€” suppress output in case that star -diff did encounter any differences.
  • ALL โ€” this is a shortcut for all error conditions below.
  • STAT โ€” suppress warnings that star could not stat(2) a file.
  • GETACL โ€” suppress warnings about files on which star had 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 about readlink(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 which star was 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 that star could not retrieve the extended file attribute information.
  • CHDIR โ€” suppress warnings about chdir(2) errors.
  • ICONV โ€” suppress warnings about iconv(3) errors. These errors happen when text is converted from or to POSIX.1-2001 extended tar headers.
  • ID โ€” suppress warnings about uid/gid range errors. These errors happen when the archive format does not support the actual value.
  • SETTIME โ€” suppress warnings about files on that star could not set the time information during extraction.
  • SETMODE โ€” suppress warnings about files on that star could 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-links has not been specified. In this case, star tries 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. If star would not skip these files, it would end up with removing the file completely. In this case, star tries 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 that star could not set the ACL information during extraction.
  • SETXATTR โ€” suppress warnings about files on that star could 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-from name โ€” Exclude from *name*d file. This is just an alias for the -X option, so go read -X for the real tea. ๐Ÿ’…
  • -F, -FF, ... โ€” The fast and simple exclude option, but only for create mode. The more Fs you stack, the more it ignores, so let's count them like a choreography: ๐Ÿ•บ
    • One -F argument: star ignores all directories called SCCS and RCS.
    • Two -F arguments: star in addition ignores all files called core, errs, a.out, all files ending with .o, and OBJ/.
    • Three -F arguments: star ignores all sub trees starting from a directory that includes a file .mirror or .exclude, plus all object files and files called core, errs, a.out, all files ending with .o.
    • Four -F arguments: star ignores all sub trees starting from a directory that includes a file .mirror or .exclude โ€” and those latter files are excluded too โ€” as well as all object files and files called core, errs, a.out, all files ending with .o.
    • Five -F arguments: star in addition again excludes all directories called SCCS and RCS. Full circle, we love a comeback. ๐ŸŒ€
  • f=tarfilename โ€” Use tarfilename as the name for the tar archive. Same thing as the file=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 support mmap() (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 the fs= 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 -f sequence are sensitive to typo problems, see BUGS section for more information. Typo on an -f option 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 -f sequence 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 100 file= options are possible. Specifying more then one file= 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:filename as in rcp(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_CREAT open 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 -f sequence are sensitive to typo problems, see BUGS section for more information.
    • See -rsh option 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 -exec primary.
  • -find โ€” This option acts as a separator. If it is used, all star options must be to the left of the -find option. To the right of the -find option, star accepts the find command line syntax only. So think of -find as 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:
      • -chatime timespec โ€” The primary always evaluates as true; it modifies the time of last access of a file in struct stat. See sfind(1) for a description of timespec.
      • -chctime timespec โ€” The primary always evaluates as true; it modifies the time of last status change of a file in struct stat. See sfind(1) for a description of timespec.
      • -chmtime timespec โ€” The primary always evaluates as true; it modifies the time of last modification of a file in struct stat. See sfind(1) for a description of timespec.
      • -chgrp gname โ€” The primary always evaluates as true; it sets the group of the file to gname.
      • -chmod mode โ€” The primary always evaluates as true; it sets the permissions of the file to mode. Octal and symbolic permissions are accepted for mode as with chmod(1).
      • -chown uname โ€” 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, -exec and the -ok primary cannot be used if stdin or stdout has been redirected by the list=- of by the file=- 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 -sparse option. 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 -sparse option 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 -f sequence are sensitive to typo problems, see BUGS section for more information.
  • -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 -f sequence 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 #. See bs= 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 -fifo option for hints on using the right fifo size. ๐ŸŒธ

  • fs-name=mount_point โ€” when star writes stuff into /etc/tardumps, and when it's comparing against what's already in /etc/tardumps for 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/tardumps and 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 the artype=headertype option, go look at that one. But heads up bestie: POSIX.1-2001 defines an option -H that follows symbolic links encountered on the command line. So because of that, the old star H=headertype option may go away in the future โ€” even though this option has literally been in use by cpio since 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 -L option (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-UX tar can 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 the xstar format, star uses a base 256 extension that allows bigger major/minor numbers by default, and if you use xustar or exustar there'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 like install(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-remove and -remove-recursive. Don't say I didn't warn you. โš ๏ธ
  • iskip=# โ€” set the initial skip size to #. See bs= 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. So iskip= 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 a bzip2 pipe. 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-recursive hasn'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 -h option. (Yes this is the same as the -h, -L entry 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 historic tar(1) implementations and to POSIX.1. POSIX.1 requests that by default no warning messages get printed, and -l enables 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 the exustar archive format, and only in the case that -sparse has 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-dirs forces 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 -D option. To force star to descend directories, use the -dodesc option in this case. See also the -X option. ๐Ÿ“

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 if list=- has been specified, it is no longer possible to use the -find -exec primary. 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 support telldir(3)/seekdir(3), star will fail. So it's a trade-off bestie. ๐Ÿ™ˆ
  • -lzip โ€” run the input or output through a lzip pipe. See section COMPRESSION for details. ๐ŸŒธ
  • -lzma โ€” run the input or output through a lzma pipe. See section COMPRESSION for details. ๐Ÿ’œ
  • -lzo โ€” run the input or output through a lzop pipe. 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 reading star, xstar, xustar, exustar, or pax/epax archives.) If star extracts other archive types, the -m flag 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-tree has 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-tree lets 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 #. See bs= 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 or M for MB), the specified size is used as specified and not multiplied by 1024. See the bs= option for all possible multipliers. ๐ŸŽ€
  • -meta โ€” in create mode, -meta causes 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 from st_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 #. Peep bs= 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 -multivol is 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: -multivol is 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 specify new-volume-script=script in 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 -ctime option 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 the tsize= 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 separate open and ioctl. ๐Ÿ’€
  • -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-dirslash may 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 -fifo option is used as default. (This may be changed at compile time.) โœจ
  • -no-fsync โ€” do not call fsync(2) for each file that has been extracted from the archive. Using -no-fsync may 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 to close(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 -p option. The -p option has a higher precedence than the -no-p option. โญ
  • -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-links below, and STAR_SECURE_LINKS in ENVIRONMENT and /etc/default/star for 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 the pattern=pattern or pat=pattern option. 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 -numeric option also applies when ACLs are going to be archived or extracted. ๐Ÿ”ข
  • -O โ€” be compatible with the old versions of tar. ๐Ÿซถ If star gets invoked with this, it generates archives that are fully compatible with old UNIX tar archives. In extract mode, star just 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 old tar versions, nor that star is trying to comprehend every bug found in old tar versions. The bug in old tar versions 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-checksum option too. And if you want directories not to be archived (for compatibility with very old historic tar archives), you need to specify the -d option 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 โ€” exit star after 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 let star exit after the first file, call -one-file together with pat=*. This is e.g. useful together with the option mtskip=#.
  • -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 -onull option, as it is a similar option as used by the sdd(1) command.
  • -P โ€” allow star to write a partial record as the last record. Normally, star writes 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 โ€” star will read up to the end of file marker on the tape, and the next call to star will 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 present umask(2). If star is called by the super user, star behaves as if it has been called with the -p option. See also -no-p option. If the archive contains Access Control Lists (ACLs) in POSIX.1-2001 extended headers, star will restore the access control lists from the archive for files if the -acl option is specified. If the option -acl has 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 100 pattern=pat options 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, star scans the whole directory tree underneath a directory that is in the argument list. This may be modified by using the -match-tree option. 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 -not option. 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 with star using the pattern= option, use pattern=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, use dir/ as file type argument. See manual page for match(1) for more details of the pattern matcher. All patterns are selection patterns by default. To make them exclude patterns, use the -not or the -V option.
  • 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 the list= option, but it allows one to overwrite the permissions, the uid and gid values from the content of the pkglist= file. Each line from the pkglist= 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 the pkglist= 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 POSIX pax. star will 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-i is an interactive option that prevents star from 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 POSIX pax and ls.
  • -pax-match โ€” allow file type arguments to be recognised as regular expressions in a way that has been defined for POSIX pax. โœจ
  • -pax-n โ€” allow each pattern to match only once. If a pattern matches a directory, then the whole sub tree matches the pattern. ๐ŸŒธ
  • -pax-o string โ€” set a pax like option control pattern.

The only argument that is currently supported is binary to create a hdrcharset=BINARY header.

  • -pax-p string โ€” 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 calling star -p -acl -xfflags.
    • m โ€” do not preserve file modification times. This is currently equivalent to calling star -m.
    • o โ€” preserve the user ID and group ID. This is the default for star if called as root.
    • p โ€” preserve the file mode bits. This is equivalent to calling star -p.
  • -pax-s replstr โ€” 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 to 61440 kBytes. See tsize=# option for more information.
  • -qic120 โ€” set tape volume size to 128000 kBytes. See tsize=# option for more information.
  • -qic150 โ€” set tape volume size to 153600 kBytes. See tsize=# option for more information.
  • -qic250 โ€” set tape volume size to 256000 kBytes. See tsize=# option for more information.
  • -qic525 โ€” set tape volume size to 512500 kBytes. See tsize=# option for more information.
  • -read0 โ€” read null terminated file names from the file specified with the list= 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 -U flag. 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-files is 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-remove or -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 named star-symtable and a directory named star-tmpdir get created in the root directory of the file system where the extraction takes place. If -restore has been specified, star behaves as if -xdot has been specified too. See also the level= 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 via rcmd(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/zero pages 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 -help menu doesn't show the -shm flag, 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 like foobar 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 is tar, ustar, suntar, pax, or any cpio variant. On Solaris-2.3 ... Solaris-2.5.1 there is a special ioctl() called _FIOAI that allows root to get the allocation info more efficiently. On Solaris 11 there is an enhanced lseek(2) call with additional whence values SEEK_HOLE and SEEK_DATA that 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 option file= or f= is omitted and the -T option is present, star will use the device indicated by the TAPE environment 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 the level= option to create true incremental dumps. See also the -wtardumps option 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 -t option 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 -diff option, 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 the list= 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. See bs= for the possible syntax. By default, the number is multiplied by 512, so the value counts in units of 512 byte blocks. If the size specifier ends with a valid multiplication character (e.g. . for bytes or M for 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 option tsize=# 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 -multivol has 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 -p option. ๐Ÿ”

  • -uncond-rename โ€” bestie, this one is so extra on purpose. When you're in interactive restore mode, or whenever the -s option 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 -t flag.) Normally star does its work silently, like a lil ghost ๐Ÿ‘ป. But if the verbose level is 2 or more and star is in create or update mode, it will spit out a listing in the format of the ls -l output. 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 the pattern=pattern or pat=pattern option. 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 -U option is not specified), star prints 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 -w is an interactive option that prevents star from 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/Solaris st device driver. ๐Ÿ› That driver has problems sensing the loading time with Exabyte drives on factory settings. It also makes sense to use -wready if 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 -wready is specified to tell star to wait for the drive to become ready again. ๐ŸŽ€
  • -wtardumps โ€” tells star to 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 also tardumps=name and the -C option, 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 -X options โ€” each argument must refer to a file containing path names. The -X option has precedence before other options that select files to be included in the operation. See also the list= 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 extracting exustar archives, 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 -dirmode option), or when the permissions of some directories must be set in any case. Here's why: the classical UNIX cpio program does not implement delayed directory permission and time stamp setting, so cpio users often create archives in reverse order (directories past their content). For this reason, it makes sense to use -xdir while extracting cpio archives. ๐Ÿ“โœจ
  • -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, so star would usually skip it during extraction. The effect of this directory is as if -xdir has 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 extracting exustar archives, since it's based on POSIX.1-2001 extended tar headers. See the NOTES section for problems with -xfflags on 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 -meta option in star's create mode. Existing files are not overwritten. If a file is missing, a zero sized file is created. And if the option -meta is 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 a xz pipe. See the COMPRESSION section for details. ๐Ÿ—œ๏ธ
  • -Z โ€” run the input or output through a compress pipe. See the COMPRESSION section for details. ๐Ÿ—œ๏ธ
  • -z โ€” run the input or output through a gzip pipe. See the COMPRESSION section for details. ๐Ÿ—œ๏ธ
  • -zstd โ€” run the input or output through a zstd pipe. 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) and st_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, and st_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), or link(2) and unlink(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 variable STAR_DEBUG exists; star does not remove files with link count 1 that have been removed between incremental dumps. These files are moved to the directory star-tmpdir. Before you start to extract the next incremental, you need to remove all files in star-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 ^C from the controlling tty. Upon receipt of a SIGINT, 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 a SIGINT.
  • SIGQUIT, SIGINFO โ€” usually generated by ^\ from the controlling tty. Upon receipt of a SIGQUIT, 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 environment COMERR_EXCODE has not been set. The value -64 / 192 in 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 the errctl= 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: The errno of 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 outdated waitpid(2) instead of the waitid(2) call to wait for the exit status from star. and why does that matter? because waitid(2) hands you the full 32 bit exit code, while waitpid(2) masks the exit code with 0377 ๐Ÿ˜ญ. without COMERR_EXCODE set, exit codes outside the range -63 .. 191 get 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 -9 and 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 to N' and the default behavior of star is as if the -no-fsync option 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 to STAR_FSYNC and STAR_SECURE_LINKS. sometimes you just want the quiet life ๐Ÿคซ.
  • STAR_SECURE_LINKS โ€” set it to N' and the default behavior of star is as if the -no-secure-links option 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 on stderr to 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 other tar(1) implementations, star defaults to use stdin/stdout for the archive. so if you like star to use the file name from the TAPE environment instead, you need to specify the -T option too. yes, both. no shortcuts ๐Ÿ’–.
  • RSH โ€” if the RSH environment is present, the remote connection will not be created via the default method, but rather uses the program specified by RSH. use e.g. RSH=/path/to/ssh to 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 the RMT environment is present, the remote tape server will not be the program /etc/rmt but the program pointed to by RMT. 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.

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-links options. If you 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. ๐Ÿซถ

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 -f situation? 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-remove and -fifo interfere with the -f option, and the fact that they exist prevents users from using filenames like e.g. ifo the traditional way, where the filename directly follows the string -f with no space between the option name and the file name.
  • but lowkey it's fine: there's no problem to use a file named ifo by calling -f ifo, f=ifo, -f=ifo or -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:

  • rsh on SunOS-5.0...SunOS-5.9
  • ssh from ssh.com
  • ssh from 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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms