Changes between Version 6 and Version 7 of Backing up Sun Directories
- Timestamp:
- 04/13/06 15:49:34 (20 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Backing up Sun Directories
v6 v7 1 = = Backing up Directories ==1 = Backing up Directories = 2 2 3 Sample commands to tar files to tape. ( See /nfs/man/notes/solaris_tape.note3 Sample commands to tar files to tape. ( See /nfs/man/notes/solaris_tape.note 4 4 for info on tape drives.) 5 5 6 Note: **Commands below to create tar files will not follow any links - just the 6 Note: 7 8 * Commands below to create tar files will not follow any links - just the 7 9 link file will be copied unless use the h switch. 8 10 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) 11 13 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. 13 15 14 (1)16 == 1 == 15 17 {{{ 16 18 > 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 21 in my_directory on the tape and rewind the tape) 22 20 23 > cd /home/my_directory/subdirectory 21 > tar xvf /dev/rmt/0 (will extract all files and subdirectories22 from the tar file on the tape and put them23 in the current directory)24 > tar xvf /dev/rmt/0 25 (will extract all files and subdirectories 26 from the tar file on the tape and put them in the current directory) 24 27 }}} 25 (2)28 == 2 == 26 29 {{{ 27 30 > 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 33 of usr and home on the tape and rewind the tape) 34 31 35 > 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 == 40 Not a good idea to make a tar file from data begining with '/', for instance: 35 41 {{{ 36 42 tar 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 45 Instead, do: 39 46 cd /home/carmen/wilds 40 47 tar cvf /dev/rmt/0 . 41 48 }}} 42 (4) To add data to a backup tape without overwriting its current contents: 49 == 4 == 50 To add data to a backup tape without overwriting its current contents: 43 51 {{{ 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 in49 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 57 compressed mode without rewinding first) 58 51 59 See also: 52 60
