comando star linux.docx

  • Upload
    mike72

  • View
    239

  • Download
    0

Embed Size (px)

Citation preview

  • 7/22/2019 comando star linux.docx

    1/23

    Linux / Unix Command: starCommand Library

    NAME

    star - unique standard tape archiver

    SYNOPSIS

    star command[ options ]file1 ... filen

    ustarcommand[ options ]file1 ... filen

    tar command[ options ]file1 ... filen

    DESCRIPTION

    Star is a very fasttar(1) like tape archiver with improved functionality.

    Star archives and extracts multiple files to and from a single file called a tarfile. A tarfile isusually 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.

    FEATURES

    Star includes the first free implementation ofPOSIX.1-2001 extended tar headers. The

    extended tar headers define a new standard way for going beyond the limitations of thehistoric 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.

    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 howto find the best fifo size.

    Star includes a pattern matcher to control the list of files to be processed. This gives aconvenient 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 onthe -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

    http://linux.about.com/library/cmd/blcmdl.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl.htm
  • 7/22/2019 comando star linux.docx

    2/23

    fetch files from a list of directories (in create mode) or to distribute files to a list of

    directories (in extract mode).

    Star includes a sophisticated diff command. 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.

    Star has no limitation on filename length. Pathnames and linknames up to PATH_MAX

    (1023 bytes with old OS versions and 4095 bytes with POSIX.1-2001) may be archived.Later versions may be able to deal with longer pathnames.

    Star deals with all 3 times, available for files on UNIX systems if the archive format iseither 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). OnSolaris 2.x systems,

    staris able to do backups without changing any of the 3 the times.

    If used with the H=ustaroption, or if called as ustar ortar while the H=headertype option

    is not used, star is 100% POSIX compliant.

    Star's default format (if called as star) isxstarand is as posix compliant as possible.

    Enhancements to the standard that prevent correct extraction of single files when using a

    different tar implementation that is only POSIX.1-1988 compliant may occur, but theyonly 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.

    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 thenstar -difftocheck for differences (see EXAMPLES for more information).

    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 to recognise allstar specific archive formats. The GNU tar format is recognised by the way it deviates from

    the standard.

    Star automatically recognizes and handles byte swapped archives. There is no option to

    manually control byte swapping.

    Star automatically recognizes and handles compressed archives inside plain files.

  • 7/22/2019 comando star linux.docx

    3/23

    Star is able to archive and restore Access Control Lists for files using POSIX.1-2001

    extended headers.

    COMMAND

    In native mode, star is compatible to the command line syntax of a typical POSIXcommand and for this reason expects commands and options to start with a single dash (-).In this case, commands and options may be specified separately, all boolean or increment

    type options may be specified either separately or combined. For compatibility with GNU

    programs, long options may alternatively start with a double dash. In compatibility mode toPOSIX tar, star expects commands and options to appear as one single string that does not

    start with a dash. In POSIX tar compatibilitx mode, additional non POSIX options may be

    specified but must appear after the POSIX options and their args and need to start with a

    dash.

    -c

    Create a new tarfile and write named files into it. Writing starts at the beginning oftarfile. See -v option for information on how to increase verbosity while the archive

    is written.

    -diffCompare 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 ofdiffopts that fits your needs, it will give - in many cases - a morereadable output than diff -r. If you use star's dump extensions for the tar archive,

    the -diffoption allows to find even if the directory in the file tree contains more

    files than the archive. This way, it is possible to compare all properties of two file

    trees in one run. See diffopts for more details.

    -nNo extraction. Show what star would do, in case the -x command had been

    specified.

    -rReplace files in a tarfile. The named files are written to the end oftarfile. This

    implies that later, the appropriate files will be found more than once on the tarfile.

    -tTable 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, orpax

    format. The option -a or-atime lists the access time instead of the modification

    time, the option -ctime lists the file creation time instead of the modification time.-u

    Update a tarfile. The named files are written to the end oftarfile if they are notalready there or if the files are newer than the files of the same name found in the

    archive. The -r and -u command only work if the tar archives is a regular file or if

    the tar archive is an unblocked tape that may backspace.

    -x

  • 7/22/2019 comando star linux.docx

    4/23

    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, starextracts no file which is older than the corresponding file on disk.

    Exactly one of the commands above must be specified.

    If one or more pattern are specified, they apply to any of the command listed above.

    OPTIONS

    -helpPrint a summary of the most important options forstar(1).

    -xhelpPrint a summary of the less important options forstar(1).

    -/Don't strip leading slashes from file names when extracting an archive. Tar archives

    containing absolute pathnames are usually a bad idea. With othertarimplementations, 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. As it may be impossible to create an archive where leading slasheshave been stripped while retaining correct path names, star does not strip leading

    slashes in create mode.

    -aclHandle Access Control List (ACL) information in create and extract mode. If-aclhas 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-aclhas been specified and star is in extract mode, star will try to restore ACLinformation. 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. If the -acl option has been specified, starassumes that the -p option has been specified too.

    -ask_removeobsoleted by -ask-remove

    -ask-removeAsk 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 ask whether it shouldremove these files to allow the extraction of a file in the following way:

    remove 'filename' ? Y(es)/N(o) :

    -atime, -a

    Reset access time of files after storing them to tarfile. On Solaris 2.x, (if invoked byroot) star uses the_FIOSATIMEioctl to do this. This enables star not to trash the

    ctime while resetting the atime of the files. If the -atime option is used in

    conjunction with the list command, star lists access time instead of modification

    http://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htmhttp://linux.about.com/library/cmd/blcmdl1_star.htm
  • 7/22/2019 comando star linux.docx

    5/23

    time. (This works only in conjunction with the star, xstar, xustar, exustar, and

    with the pax format.) Another option to retain the access time for the the files that

    are going to be archives is to readonly mount a UFS snapshot and to archive files

    from the mount point of the UFS snapshot.

    -B

    Force star to perform multiple reads (if necessary) to fill a block. This option existsso that star can work across the Ethernet, since pipes and sockets return partialblocks even when more data is coming. Ifstar usesstdin as archive file, star

    behaves as if it has been called with the -B option. For this reason, the option -B in

    practice is rarely needed.

    -block-numberPrint the archive block number (archive offset / 512) at the beginning of each line

    when in verbose mode. This allows to write backup scripts that archive the offsets

    for files and that use

    mt fsr blockno

    to skip to the tape block number of interest in a fast wayif a single file needs to be restored.

    blocks=#, b=#Set the blocking factor of the tarfile to # times 512 bytes (unless a different

    multiplication factor has been specified - see bs= option for posible multiplication

    factors). Changing the blocking factor only makes sense when the archive is locatedon a real tape device or when the archive is accessed via the remote tape protocol

    (see f= option below). The default is to use a blocking factor of 20 i.e. 10 kBytes.

    Increasing the blocksize will speed up the backup. For portability with very old tar

    implementations (pre BSD 4.2 or pre AT&T SVR4), blocksize should not be morethan 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 for the 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

    make sure that the target system will handle the intended blocksize. If you use star

    for data exchange via tape, it is a good idea to use a blocksize of 10 kBytes unlessyou are sure that the reading system will handle a larger blocksize. If you use star

    for backup purposes with recent hardware (e.g. DLT tape drives), a blocksize of

    256 kBytes results in sufficient speed and seems to be a good choice. Star allows

    block sizes up to 2 GByte if the system does not impose a smaller limit. If you wantto determine the blocking factor when reading an unknown tar archive on tape,

    specify a blocking factor that is higher than the supposed blocking factor of the

    tape. Star then will determine the blocking factor by reading the first record of thetape 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. The blocks=

  • 7/22/2019 comando star linux.docx

    6/23

    option is preferred by people who like to use an option that behaves similar to the

    interface of the historictar(1) implementations.

    bs=#

    Set output block size to #. You may use the same method as indd(1) and sdd(1).

    The number representing the size is taken in bytes unless otherwise specified. If anumber 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. If the size consists of

    numbers separated by `x' or `*', multiplication of the two numbers is performed.Thus bs=7x8kwill 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 option bs= is preferred by people who like to use an option that

    behaves similar to the interface used bydd(1) and sdd(1).

    -bzrun the input or output through a bzip2 pipe - see option -zbelow. As both the -bz

    and the -z option are non standard, it makes sense to omit the -bz and the -z insideshell scripts if you are going to extract a compressed archive that is located inside a

    plain file as star will auto detect compression and choose the right decompression

    option to extract.

    C=dir

    Perform achdir(2) operation to dirbefore storing or extracting the next files. In all

    cases, star will perform thechdir(2) operation relative to the current working

    directory of the shell.

    *In list mode (with the -t flag), star ignores all -Coptions.

    *In create mode (with the -c, -r and -u flag), star walks through all -Coptions and

    file type arguments. While a BSD derivedtar(1) implementation goes back to the

    current working directory after storing one file argument that immediately follows

    the -Coption, star changes the directory only if a new -C option follows. Toemulate the behavior of a BSD derivedtar(1), add a -C . option after the file

    argument.

    *In extract mode (with the -x, -n and -diffflag), star builds a pattern list together

    with corresponding directories from previous C=diroptions and performs a

    chdir(2) to the corresponding directory of a matching pattern. All pat= options that

    do not follow a C=diroption are interpreted as if they were preceded by a -C .option. See EXAMPLES for more information.

    -copylinksThis option allows to copy hard/symlinks targets rather than creating a link. It helpsto extract tar files on systems that do not implement links (e.g. OS/2). To extract

    and copy all symlinks correctly, you may need to call star twice as star cannot copy

    files that appear in the archive later than a symlink pointing to them.

    -ctimeIf used with the list command, this lists ctime rather than mtime if the archive format

    is star, xstar, xustar, exustar, orpax. If used with the extract command and the

    http://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl2_chdir.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_dd.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htm
  • 7/22/2019 comando star linux.docx

    7/23

    same archive formats, this tries 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. If used with the create command this

    changes the behavior of the newer= option. Star, in this case compares the ctime ofall files to the mtime of the stamp file rather then comparing the mtimes of both

    files.-DDo not descend directories. Normally, star descends the whole tree if it encounters

    a directory in in its file parameters. The option -D is in effect by default if the

    list=file option is used. If you like star to descend directories found in the list file,use the -dodesc option (see below).

    -dDo not store/create directories. Old versions oftar such as published with the

    seventh edition of UNIX are not able to deal with directories in tar archives. If a tar

    archive is generated without directories this avoids problems with tarimplementations found on SYSVr3 and earlier.

    -debugPrint debug messages. Among other things, this gives debug messages for headertype recognition, tar type properties, EOF recognition, opening of remote archives

    and fifo internals.

    diffopts=optlstComma separated list of diffopts. Valid members in optlstare:

    helpPrint a summary of possible members of the diffopts list.

    !Invert the meaning of the following string. No comma is needed after the

    exclamation mark.

    notInvert the meaning of all members in the diffopts list i.e. exclude all present options

    from an initially complete set compare list. When usingcsh(1) you might have

    problems to use ! due to its strange parser. This is why the not alias exists.

    permCompare file permissions. With this option in effect, star compares the low order

    12 bits of the st_mode field.

    modeSame asperm.

    typeCompare file type. Note that star cannot compare the file type in case of a hard link.

    nlinkCompare link count on hardlinks. This only works if the archive is in exustar

    format and contains star's dump extensions.

    uidCompare numerical user id of file.

    gidCompare numerical group id of file.

    uname

    http://linux.about.com/library/cmd/blcmdl1_csh.htmhttp://linux.about.com/library/cmd/blcmdl1_csh.htmhttp://linux.about.com/library/cmd/blcmdl1_csh.htmhttp://linux.about.com/library/cmd/blcmdl1_csh.htm
  • 7/22/2019 comando star linux.docx

    8/23

    Compare ASCII version of user id of file. The user name is mapped via the file

    /etc/passwd.

    gnameCompare ASCII version of group id of file. The group name is mapped via the file/etc/group.

    idShorthand for: uid,gid,uname,gname. Compare 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.

    sizeCompare file size. Note that star cannot compare the file size in case of a hard link.

    dataCompare content of file. Ifstar already found that the size of the files differ, it will

    not compare the content anymore.

    contSame as data.

    rdevCompare major/minor numbers for device nodes.

    hardlinkCompare target of hardlinks.

    symlinkCompare target of symlinks. This evaluates the value returned by thereadlink(2)

    call.

    atimeCompare access time of file. This only works with if the archive format is star,

    xstar, xustar, exustar, orpax.

    mtimeCompare modification time of file.

    ctimeThis only works with if the archive format is star, xstar, xustar, exustar, orpax.

    timesShorthand for: atime,mtime,ctime.

    dirCompare the content of directories. This only works if the archive is in exustar

    format and contains star's dump extensions. Together with 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.

    Ifoptlststarts with a ! the meaning of all members in optlstis inverted as with the

    notoptlist member.

    Ifdiffopts are not specified, star compares everything but the access time of the

    files.

    -dirmode

    http://linux.about.com/library/cmd/blcmdl2_readlink.htmhttp://linux.about.com/library/cmd/blcmdl2_readlink.htmhttp://linux.about.com/library/cmd/blcmdl2_readlink.htmhttp://linux.about.com/library/cmd/blcmdl2_readlink.htm
  • 7/22/2019 comando star linux.docx

    9/23

    If 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.

    -dodescForce star to descend directories found in a list=file. See also the -D option above.

    -dumpThis currently is an experimental option to make it easier to implement a starversion that supports true incremental dumps. Star currently sets the archive type to

    exustar and archives more inode meta data inside POSIX.1-2001 extended headers.

    -F,-FF ...Fast and simple exclude option for create mode. With one -F argument, star ignores

    all directories called SCCSandRCS. With two -F arguments, star in addition

    ignores all files called core errs a.outall files ending with .o. OBJ/. With three -F

    arguments, star ignores all sub trees starting from a directory that includes a file

    .mirroror.exclude and all object files and files called core errs a.outall files endingwith .o. With four-F arguments, star ignores all sub trees starting from a directory

    that includes a file .mirroror.exclude the latter files are excluded too as well as and

    all object files and files called core errs a.outall files ending with .o. With five -Farguments, star in addition again excludes all directories called SCCSandRCS.

    -fifoUse afifo to optimize data flow from/to tarfile. This option is in effect by default (itmay be changed at compile time). 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 will starmake even work on a tiny machine like a Sun 3/50. The fifo size may be modified

    with thefs= option. A rule of dumb for the fifo size is to use more than the buffer

    size of the tape drive and less then half of the real memory of the machine. A good

    choice would be to use a fifo size between 8 and 256 MB. This may increasebackup speed up to 5% compared to the speed achieved with the default fifo size.

    Note that with a DLT drive that gives 12MB/s transfer rate, a fifo of 256 MB size

    will keep the tape at least streaming in units of 20 seconds. All options that startwith the -fsequence are sensitive to typo problems, see BUGS section for more

    information.

    -fifostatsPrint fifo statistics at the end of a star run when the fifo has been in effect. Alloptions that start with the -fsequence are sensitive to typo problems, see BUGS

    section for more information.

    file=tarfilename, f=tarfilename

    Use tarfilename as the name for the tar archive. Currently up to 100 file= optionsare 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 starbehave consistent with the single file case, star loops overthe list of known archive files. Note that ifstar is installed suid root and the first

    tarfile is a remote archive, only the connection to this archive will be created with

    root privilleges. After this connection has been established as root, star switchesback 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.

  • 7/22/2019 comando star linux.docx

    10/23

    Star normally usesstdin/stdoutfor the tar archive because the most common wayto use star is in conjunction with pipes. Ifstar 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 ifstar talks to an old rmt remote tape server that does not supportsymbolic 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 thesymbolic mode for the open flags. Only the symbolic open modes allow to send 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 rmtserver that gives platform independent compatibility with BSD, Sun and GNU

    rmtclients and it includes security features that may be set up in /etc/default/rmt. All

    options that start with the -fsequence are sensitive to typo problems, see BUGSsection for more information.

    -force_holeobsoleted by -force-hole

    -force-holeTry to extract all files with holes. This even works with files that are created withoutthe -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. This option should

    be used with extreme care because you sometimes get in trouble when files get

    unattended holes. All options that start with the -fsequence are sensitive to typoproblems, see BUGS section for more information.

    -force_removeobsoleted by -force-remove

    -force-removeForce 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 filesto allow the extraction of a file. All options that start with the -fsequence are

    sensitive to typo problems, see BUGS section for more information.

    fs=#

    Set fifo size to #. See bs= for the possible syntax. The default size of the fifo is 1Mbyte 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.

    H=headertypeGenerate 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. As star even

    in case of a user selected extract archive format does format checking, it may be thatyou will not be able to unpack a specific archive with all possible forced archive

    mailto:user@hostmailto:user@hostmailto:user@hosthttp://linux.about.com/library/cmd/blcmdl1_rcp.htmhttp://linux.about.com/library/cmd/blcmdl1_rcp.htmhttp://linux.about.com/library/cmd/blcmdl1_rcp.htmmailto:user@host
  • 7/22/2019 comando star linux.docx

    11/23

    formats. Selecting the old tar format for extraction will always work though. Valid

    parameter forheadertype are:

    helpPrint a help message about possible header types.

    tar

    Old UNIX tar format. This archive format may only store plain files, directoriesand symbolic links. Pathnames or linknames longer than 99 chars may not bearchived. 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 tarformat. File size is limited to 2 GB - 2 bytes, uid/gid is limited to 262143. Sparse

    files will be filled up with zeroes.

    starOld star standard format. This is an upward/downward compatible enhancement of

    the old(pre Posix) UNIX tar format. It has been introduced in 1985 and therefore isnot Posix compliant. The star format allows to archive special files (even sockets)

    and records access time and creation time besides 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. This format is able to copy thedevice nodes on HP-UX that have 24 bits in the minor device number, which is

    more then the 21 bits that are possible with the POSIX-1003.1-1988 archive format.

    gnutarThis is a commonly used, but unfortunately not Posix compliant (although designed

    after 1987) enhancement to the old tar format. 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 basicrules for any (even the historic) tar archive format. Using the gnutar archive formatcauses 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, butsufficient for most gnutar archives. See NOTES for more information.

    ustarIEEE/Posix1003/IEC-9945-1-1988 Standard Data Interchange format. 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. Ifstar 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 befilled up with zeroes.

    paxThe IEEE/Posix1003/IEC-9945-1-1988 successor, the POSIX-1003.1-2001

    Standard Data Interchange format.

  • 7/22/2019 comando star linux.docx

    12/23

    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.

    xstarExtended standard tar format. 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.The xstar format is the default format when star is neither called as tar nor called

    as ustar.

    xustarNew format introduced 1998, that omits the tarsignature at the end of the tarheader. 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 tarimplementations. The main other difference to the xstar format is that the 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 thedefault format when star is called as tar.

    File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor isunlimited. Sparse files will be archived correctly.

    exustarA 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.

    File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is

    unlimited. Sparse files will be archived correctly.

    suntarThe extended header format found on Solaris 7/8. This format is similar to the paxformat but does not handle atime and ctime and in addition uses 'X' as the typeflag

    for the extended headers instead of the standard 'x'.

    File size is unlimited, uid/gid/uname/gidname is unlimited, major/minor is

    unlimited. Sparse files will be filled up with zeroes.

    All tar archive formats may be interchanged if the archive contains no files that

    may not be archived by using the old tar format. Archives in thexstarformat may

    be extracted by any 100% POSIX compliant tar implementation if they contain nofiles with pathnames > 100+130 chars and if they contain no sparse files that have

    been archived by using the -sparse option.

  • 7/22/2019 comando star linux.docx

    13/23

    -h, -LFollow symbolic links as if they were files. Normally star will not follow symbolic

    links but stores their values in tarfile. See also the -L option.

    -hardlinksIn extract mode, this option tells star to try to create a hardlink whenever a symlink

    is encountered in the archive. In create mode, this option tells star to try to archive ahardlink whenever a symlink is encountered in the file system.

    -hpdevAllow 24 bits for the minor device number using 8 octal digits. Note that although it

    allows to create tar archives that can be read with HP-UX tar, this creates tararchives which violate POSIX.1-1988. This option is only needed if you like to use

    a POSIX.1-1988 based archive format that does not include extensions. If you use

    the xstar format, star will use a base 256 extension that allows bigger major/minor

    numbers by default, if you use the xustar or the exustar format there is no

    limitation at all as these formats use POSIX.1-2001 extended headers to archive themajor/minor numbers by default.

    -iIgnore checksum errors on tar headers. If this option is specified, star will not exitif a header with a bad checksum is found but search for the next valid header.

    -IObsolete option, otherwise identical to -w.

    -keep_old_filesobsoleted by -keep-old-files

    -keep-old-files, -kKeep existing files rather than restoring them from tarfile. This saves files from

    being clobbered even iftarfile contains a more recent version of the corresponding

    file.

    -L, -hFollow 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.

    -lDo not print a warning message if not all links to hard linked files could be dumped.

    This option is evaluated in the opposite way to historictar(1) implementations and

    to POSIX.1. POSIX.1 requests that by default no warning messages will be printed

    and -l will enable warning messages when not all links could be archived.

    -link-dirsWhen in create mode, try to find hard linked directories. Using -link-dirs will force

    star to keep track of all directories that will go into the archive and thus causes a lot

    more memory to be allocated than in the default case.

    Note that not all filesystem allow to create hard links to directories. Also note thateven though a non-root user is able detect and archive hard linked directories, all

    known operating systems require the extraction to be done as root in order to be

    able to create or remove hard links to directories. For this reason its only

    recommended to use this option when doing accurate backups and when hard linksto directories are expected.

    http://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htm
  • 7/22/2019 comando star linux.docx

    14/23

    When the option -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.

    list=filename

    Read filenames for store/create/list command fromfilename. The filefilename mustcontain a list of filenames, each on a separate line. This option implies the -Doption. To force star to descend directories, use the -dodesc option in this case.

    -lowmemTry to run with reduced memory requirements. This causes star to default to 1 MBof FIFO memory. Instead of allocating memory to hold the directory content and

    reading the directory at once, star reads the directory name by name. This may

    cause star to close the directory if it rans out of file descriptors because of deeply

    nested directories. If a directory then does not supporttelldir(3)/seekdir(3), starwill fail.

    -MDo not descend mount points. This is useful when doing backups of completefilesystems. See NOTES for more information.

    -mDo not restore access an modification time. (Access time is only available ifstar isreading star, xstar, xustar, exustar, orpax archives). Ifstar extracts other archive

    types, the -m flag only refers to the modification time.

    maxsize=#

    Do not store files in tarfile if they are 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 bs=option for all possible multipliers.

    -metaThis currently is an experimental option. In create mode, it causes star to archive all

    meta data of the file (e.g. uid, permissions, ...) bit not the file content. In extractmode, it causes star to restore all meta data but not the file content. In addition, in

    extract mode no plain file, special file or directory will be created. Meta files are

    needed in future star versions that support incremental backups.

    Warning: Do not try to extract star archives containing meta files using other tarimplementations if they are not aware of the meta file extensions ofstar. Star tries

    to force all tar implementations that are not standard compliant to abort. Star alsotries to make all non POSIX.1-2001 compliant tar implementations unable to find a

    valid filename. However when other POSIX.1-2001 aware tar implementations

    come up and don't know about meta files, they will destroy files on disk.

    The problems result from the only current fallback in the POSIX standard that tellstar implementations to treat all unknown file types as if they were plain files. As

    meta files are needed for incremental backups, I am looking for people and

    companies who like to support me to be able to add the meta file concept to the

    POSIX.1-2005 standard.

    http://linux.about.com/library/cmd/blcmdl3_telldir.htmhttp://linux.about.com/library/cmd/blcmdl3_telldir.htmhttp://linux.about.com/library/cmd/blcmdl3_telldir.htmhttp://linux.about.com/library/cmd/blcmdl3_seekdir.htmhttp://linux.about.com/library/cmd/blcmdl3_seekdir.htmhttp://linux.about.com/library/cmd/blcmdl3_seekdir.htmhttp://linux.about.com/library/cmd/blcmdl3_seekdir.htmhttp://linux.about.com/library/cmd/blcmdl3_telldir.htm
  • 7/22/2019 comando star linux.docx

    15/23

    -modebitsThis options allows you to create tar archives that include more than 12 bits from

    st_mode. Note this create tar archives that violate POSIX but some tar

    implementations insist in reading such nonstandard archives.

    newer=filename

    Do not store files to tarfile if their modification time is not newer than themodification time offilename. See -ctime option for changing this behavior.

    -newestIn conjunction with the list command this lists you only the newest file in tarfile.

    -newest_fileobsoleted by -newest-file

    -newest-fileIn conjunction with the list command this lists you only the newest regular file in

    tarfile.

    new-volume-script=scriptCallscriptat end of each tape if in multi volume mode. If this option is not in

    effect, star will ask the user to confirm the volume change.

    -nodumpIf 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 by10%) because of the unlucky kernel interface.

    -no_fifoobsoleted by -no-fifo

    -no-fifoDon't use afifo to optimize data flow from/to tarfile. Currently the -fifo option is

    used as default. (This may be changed at compile time.)

    -nochown, -oDo 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_statisticsobsoleted by -no-statistics

    -no-statisticsDo not print statistic messages at the end of a star run.

    -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 orpat=pattern option. Patterns specified as file typearguments will not be affected.

    -nowarnDo not print warning messages. This sometimes is useful to make the output morereadable (e.g. when hundreds of files that are going to be extracted are not newer in

    the archive then on the filesystem).

    -numericUse the numeric user/group fields in the listing rather than the default. The default

    allows to list the ASCII version of user/group of the file and to extract the owners of

  • 7/22/2019 comando star linux.docx

    16/23

    the files based on numeric values rather than the names. In create mode, no

    user/groups names are put on the archive. The -numeric option also applies when

    ACLs are going to be archived or extracted.

    -OBe compatible to old versions oftar. Ifstar is invoked with this option, star

    generates archives which are fully compatible with old UNIX tar archives. If inextract mode, star ignores any additional info in the headers. This implies neitherthat archives generated with this option are binary equal with archives generated by

    old tar versions nor that star is trying to comprehend all bugs that are found in old

    tar versions. The bug in old tar versions that cause a reversal of a space and aNULL byte in the checksum field is not repeated. If you want to have signed

    checksums you have to specify the -singed-checksum option too. If you want

    directories not to be archived in order to be compatible to very old historic tar

    archives, you need to specify the -doption too.

    This option is superseeded 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 filesshould not change.

    -onull, -nullout

    Do not actually write to the archive but compute and add the sizes. This is usefulwhen 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.

    -PAllow star to write a partial record as the last record. Normally, star writes eachrecord with the same size. This option is useful on unblocked tapes i.e. cartridgetapes 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 oncartridge tapes, is 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.

    -pRestore filemodes of directories. Without this option directories are created using

    the presentumask(2). If in create mode (i.e. when storing files to archive), star

    stores directories past the corresponding files. This guarantees that even old tar

    implementations will be able to restore the correct times of directories. If thearchive 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.

    pattern=pattern, pat=pattern

    Set matching pattern topattern. A maximum of 100 pattern=pat options may be

    specified. As each pattern is unlimited in length, this is no real limitation. If morethan one pattern is specified, a file matches if any of the specified pattern 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. In

    http://linux.about.com/library/cmd/blcmdl2_umask.htmhttp://linux.about.com/library/cmd/blcmdl2_umask.htmhttp://linux.about.com/library/cmd/blcmdl2_umask.htmhttp://linux.about.com/library/cmd/blcmdl2_umask.htm
  • 7/22/2019 comando star linux.docx

    17/23

    extract or list mode, all file type arguments are interpreted to be select pattern 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 to

    restore subtrees. To extract a complete sub tree from the directory dirwith starusing the pattern= option, use pattern=dir/\\* if you like to select a subtree byusing the historic method, 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.

    -qic24Set tape volume size to 61440 kBytes. See tsize=#option for more information.

    -qic120Set tape volume size to 128000 kBytes. See tsize=#option for more information.

    -qic150Set tape volume size to 153600 kBytes. See tsize=#option for more information.

    -qic250Set tape volume size to 256000 kBytes. See tsize=#option for more information.

    -refresh_old_filesobsoleted by -refresh-old-files

    -refresh-old-files

    -refreshDo not create new files. Only already existing files may be overwritten from tarfile

    if either newer versions are present in the archive or if the -U flag is used. Thisallows to overwrite files by more recent files from an archive that contains more

    files than the target directory should contain. The option -refresh-old-files is the

    same as the -refresh option.

    -remove_firstobsoleted by -remove-first

    -remove-firstRemove files before extraction. If this option is in effect, star will remove filesbefore extracting a file from the archive. This is needed if you want to change the

    file type or if you need to break a hard link. If you do not use either-ask-remove or

    -force-remove together with -remove-first, this option is useless and no files will

    be removed.

    -remove_recursiveobsoleted by -remove-recursive

    -remove-recursiveRemove files recursive. If removing of a file is permitted, star will only removefiles, specials and empty directories. If this option is in effect, star will be allowed

    to recursively removes non empty directories too.

    -SDo not store/create special files. A special files is any file except plain files,

    symbolic links and directories. You need to be super user to extract special files.

    -shmUse 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. Ifstar is compiled

    http://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htmhttp://linux.about.com/library/cmd/blcmdl1_tar.htm
  • 7/22/2019 comando star linux.docx

    18/23

    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 sharedmemory forstar.

    -signed_checksumobsoleted by -signed-checksum

    -signed-checksumUse signed chars to calculate checksums. This violates the tar specs but old

    versions oftar derived from the seventh edition of UNIX are implemented in thisway. 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.

    -silentSuppress informational messages likefoobar is sparse.

    -sparseHandle files with holes effectively on store/create. Note that sparse files may not be

    archived this way if the archive format is tar, ustar, pax, orsuntar. On Solaris-2.3... Solaris-2.5.1 there is a special ioctl() called_FIOAIthat allows root to get the

    allocation info more efficiently. Other operating systems lack support to get the real

    allocation list and force star to scan the files to look for blocks that only containnull characters. This may star to assume more holes to be present than the number

    that the file really contains.

    -symlinksThis option tells star in extract mode to try to create a symlink whenever a hardlink

    is encountered in the archive.

    -TIf the option file= orf= is omitted and the -T option is present, star will use thedevice indicated by the TAPE environment variable, if set.

    -timePrint timing info. See DIAGNOSTICS for more information.

    -to_stdoutobsoleted by -to-stdout

    -to-stdoutExtract files to stdout. This option may be used to extract tarfiles containing tarfiles(see examples below).

    -tpathUse this option together with the -toption 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 usedtogether with the -diffoption, star will only print the names of the files that differ.

    A second run ofstar 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. See bs= for the

    possible syntax. By default, the number is multiplied by 512, so the value counts inunits 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

  • 7/22/2019 comando star linux.docx

    19/23

    not multiplied by 512. With this option in effect, star is able to archive filesystems

    that are bigger then the tape size. Files that do not fit on a single tape may not be

    stored with the current version ofstar.

    -URestore files unconditionally. By default, an older file from the archive will not

    replace a corresponding newer file on disk.-vIncrement verbose level by one. This normally results in more output during

    operation. See also in the description for the -tflag. Normally, star does its work

    silently. If the verbose level is 2 or more and star is in create or update mode, starwill produce a listing to the format of the ls -l output.

    -V, -not

    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 orpat=pattern option. Patterns specified as file typearguments will not be affected.

    -versionPrint version information and exit.

    VOLHDR=name

    Use name to generate a volume header.

    -wDo 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) starprints its name and asks:

    get/put ? Y(es)/N(o)/C(hange name) :

    You may answer either `N' for No or to skip this file. If you answer `Y'the file is extracted or archived on tape with its original name. If you answer `C',

    you are prompted for a new name. This name is used for the filename on disk ifstaris in extract mode or for the archive name ifstar is in create mode.

    Star

    waits up to one minute for the drive to become ready if this option is specified. -

    wready This option tells Star waits up to two minutes for the drive to becomeready. It has been added as a hack for a bug in the SunOS/Solarisstdevice driver.

    This driver has problems to sense the loading time with Exabyte drives with factory

    settings. It also makes sense to use -wready if multiple remote backups are made. In

    this case, the remote connection is closed while the remote tape server is stillwriting a file mark. If another remote backup is initiated before the old remote

    server did finish to write the 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 readyagain.

    -xdirExtract directories even if the corresponding directories on the archive are notnewer. This is useful when for some reason, the directories are recorded after their

    content (see -dirmode option), or when the permissions of some directories must be

    set in any case.

  • 7/22/2019 comando star linux.docx

    20/23

    -xfflagsStore and extract extended file flags as found on BSD and Linux systems. This

    option only makes sense when creating or extracting exustar archives as it is based

    on POSIX.1-2001 extended tar headers.

    -z

    run the input or output through a gzip pipe. This is currently a quick and dirty hack,that mainly will cover the most common usage to compress the tar output if it is afile. No reblocking will be done, so this option will currently only make sense on

    plain files. The environment variable As both the -bz and the -z option are non

    standard, it makes sense to omit the -bz and the -z inside shell scripts if you aregoing to extract a compressed archive that is located inside a plain file as star will

    auto detect compression and choose the right decompression option to extract.

    STAR_COMPRESS_FLAG may be used to specify one option for gzip. If you

    want to write write compressed archives to tape, you should use

    star -c . | gzip | sdd ibs=4k obs=32k -fill of=/dev/rmt/1bnor

    star -c . | gzip | sdd ibs=4k obs=32k -fill ovsize=60m of=/dev/rmt/1bn

    if the tape can hold 60 MB.

    SIGNALS

    Ifstar handles a signal, it first prints the statistics. Star handles the following signals:

    SIGINTusually generated by ^C from the controlling tty. Upon receipt of a SIGINT, starprints statistics and exits. If 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, write aneof record and then exits.

    SIGHUPnot to be generated from a tty. The actions are the same as upon receipt of a

    SIGINT.

    SIGQUITusually generated by ^\ from the controlling tty. Upon receipt of a SIGQUIT, starprints statistics and continues with the current operation. This is useful to watch the

    progress of the current operation.

    EXAMPLES

    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:

  • 7/22/2019 comando star linux.docx

    21/23

    example% star tvf /dev/rmt/1mbn

    To copy the directory tree in/home/someuserto the directory/home/fs use:

    example% (cd /home/someuser; star -c .) | (cd /home/fs ; star -xp)

    or by using the change directory option ofstar:

    example% star -c -C /home/someuser . | star -xp -C /home/fs

    To copy a file tree including the Access Control List entries for all files use:

    example% star -c -Hexustar -acl -C /home/someuser . | star -xp -acl

    -C /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

    To compare all properties of two file trees, use:

    example% star -c -dump -C fromdir . | star -C todir -diff -vv

    To extract a backup of the /usr tree without all files residing below /usr/openwin one mightuse:

    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.

  • 7/22/2019 comando star linux.docx

    22/23

    To backup a list of files generated by thefind(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.

    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.

    To make a backup of the root filesystem to a tape drive connected to a remote machine, onemight 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 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 doneby generating a list containing the needed filenames and using the list= option or by usingthe 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

    http://linux.about.com/library/cmd/blcmdl1_find.htmhttp://linux.about.com/library/cmd/blcmdl1_find.htmhttp://linux.about.com/library/cmd/blcmdl1_find.htmmailto:tape@remotehostmailto:tape@remotehostmailto:tape@remotehosthttp://linux.about.com/library/cmd/blcmdl1_find.htm
  • 7/22/2019 comando star linux.docx

    23/23

    If you are looking for files that changed the type or the access permission because this is acommon case on still corrupted files, use:

    example# star -diff -tpath diffopts=type,perm f=/dev/rmt/1bn