Changes between Version 6 and Version 7 of Backing up Sun Directories


Ignore:
Timestamp:
04/13/06 15:49:34 (20 years ago)
Author:
cdelarcuz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Backing up Sun Directories

    v6 v7  
    1 == Backing up Directories ==
     1= Backing up Directories =
    22
    3  Sample commands to tar files to tape.          ( See /nfs/man/notes/solaris_tape.note
     3Sample commands to tar files to tape.           ( See /nfs/man/notes/solaris_tape.note
    44                                                        for info on tape drives.)
    55
    6  Note:  **Commands below to create tar files will not follow any links - just the
     6Note: 
     7
     8 * Commands below to create tar files will not follow any links - just the
    79          link  file will be copied unless use the h switch.
    810          Also when extracting tar files, not all mode settings will be preserved unless
    9           use the p switch.**
    10         **To put more than one tar file per tape, use device name /dev/rmt/0n(n=norewind)
     11          use the p switch.
     12 * To put more than one tar file per tape, use device name /dev/rmt/0n(n=norewind)
    1113          and also the 'mt'  command to position the tape past the last tar file written.
    12           See 'man mt'. and example 4) below.**
     14          See 'man mt'. and example (4) below.
    1315
    14 (1)
     16== 1 ==
    1517{{{
    1618> cd /home/my_directory
    17 > tar cvf /dev/rmt/0 .          (will put all files and subdirectories found
    18                                          in my_directory on the tape and rewind
    19                                          the tape)
     19> tar cvf /dev/rmt/0 .         
     20(will put all files and subdirectories found
     21in my_directory on the tape and rewind the tape)
     22
    2023> cd /home/my_directory/subdirectory
    21 > tar xvf /dev/rmt/0            (will extract all files and subdirectories
    22                                          from the tar file on the tape and put them
    23                                         in the current directory)
     24> tar xvf /dev/rmt/0           
     25(will extract all files and subdirectories
     26from the tar file on the tape and put them in the current directory)
    2427}}}
    25 (2)
     28== 2 ==
    2629{{{
    2730> cd /
    28 > tar cvf /dev/rmt/0  usr  home       (will put directories usr and home
    29                                                     and all subdirectories of usr and home on the
    30                                                     tape and rewind the tape)
     31> tar cvf /dev/rmt/0  usr  home       
     32(will put directories usr and home and all subdirectories
     33of usr and home on the tape and rewind the tape)
     34
    3135> cd /tmp
    32 > tar xvf /dev/rmt/0    home            (will extract directory home and all its
    33 }}}                                                 subdirectories to the current directory)
    34 (3) Not a good idea to make a tar file from data begining with '/', for instance:
     36> tar xvf /dev/rmt/0    home           
     37(will extract directory home and all its subdirectories to the current directory)
     38}}}
     39== 3 ==
     40Not a good idea to make a tar file from data begining with '/', for instance:
    3541{{{     
    3642tar cvf /dev/rmt/0  /home/carmen/wilds 
    37     If you try to restore this, you will get permission denied errors.
    38     Instead, do:
     43(If you try to restore this, you will get permission denied errors.)
     44
     45Instead, do:
    3946cd /home/carmen/wilds
    4047tar cvf /dev/rmt/0 .
    4148}}}
    42 (4)  To add data to a backup tape without overwriting its current contents:
     49== 4 ==
     50To add data to a backup tape without overwriting its current contents:
    4351{{{
    44         > mt -f /dev/rmt/0n eom         (will space out past the EOF mark)
    45         > tar cvf /dev/rmt/0hn  . > /tmp/newbackup.log &
    46                                         (will backup the current
    47                                          directory and all
    48                                         subdirectories below in
    49                                          compressed mode without
    50                                          rewinding first)
     52> mt -f /dev/rmt/0n eom         
     53(will space out past the EOF mark)
     54
     55> tar cvf /dev/rmt/0hn  . > /tmp/newbackup.log &
     56(will backup the current directory and all subdirectories below in
     57compressed mode without rewinding first)
     58
    5159See also:
    5260