Changes between Version 8 and Version 9 of Backing up Sun Directories
- Timestamp:
- 04/13/06 15:57:28 (20 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Backing up Sun Directories
v8 v9 7 7 8 8 * Commands below to create tar files will not follow any links - just the 9 link file will be copied unless use the h switch. Also when extracting 10 tar files, not all mode settings will be preserved unless 11 use the p switch. 9 link file will be copied unless use the h switch. Also when extracting 10 tar files, not all mode settings will be preserved unless use the p switch. 12 11 13 12 * To put more than one tar file per tape, use device name /dev/rmt/0n(n=norewind) 14 and also the 'mt' command to position the tape past the last tar file written.15 See 'man mt'. and example (4) below.13 and also the 'mt' command to position the tape past the last tar file written. 14 See 'man mt'. and example (4) below. 16 15 17 == 1 ==16 === Place all files and subdirectories found in my_directory on the tape and rewind the tape === 18 17 {{{ 19 18 > cd /home/my_directory 20 19 > tar cvf /dev/rmt/0 . 21 (will put all files and subdirectories found 22 in my_directory on the tape and rewind the tape) 23 20 }}} 21 === Extract all files and subdirectories from the tar file on the tape and put them in the current directory === 22 {{{ 24 23 > cd /home/my_directory/subdirectory 25 24 > tar xvf /dev/rmt/0 26 (will extract all files and subdirectories27 from the tar file on the tape and put them in the current directory)28 25 }}} 29 == 2 ==26 === Place directories usr and home and all subdirectories of usr and home on the tape and rewind the tape === 30 27 {{{ 31 28 > cd / 32 29 > tar cvf /dev/rmt/0 usr home 33 (will put directories usr and home and all subdirectories 34 of usr and home on the tape and rewind the tape) 35 30 }}} 31 === Extract directory home and all its subdirectories to the current directory === 32 {{{ 36 33 > cd /tmp 37 34 > tar xvf /dev/rmt/0 home 38 (will extract directory home and all its subdirectories to the current directory)39 35 }}} 40 == 3 == 41 Not a good idea to make a tar file from data begining with '/', for instance: 36 === Not a good idea to make a tar file from data begining with '/', for instance === 42 37 {{{ 43 38 tar cvf /dev/rmt/0 /home/carmen/wilds … … 48 43 tar cvf /dev/rmt/0 . 49 44 }}} 50 == 4 == 51 To add data to a backup tape without overwriting its current contents: 45 === To add data to a backup tape without overwriting its current contents === 52 46 {{{ 53 47 > mt -f /dev/rmt/0n eom 54 48 (will space out past the EOF mark) 49 }}} 50 === Backup the current directory and all subdirectories below in compressed mode without rewinding first === 51 {{{ 52 > tar cvf /dev/rmt/0hn . > /tmp/newbackup.log & 53 }}} 55 54 56 > tar cvf /dev/rmt/0hn . > /tmp/newbackup.log & 57 (will backup the current directory and all subdirectories below in 58 compressed mode without rewinding first) 59 60 See also: 61 62 Sample script to dump a file system to tape. 63 64 Script below copies four file systems to the same tape. A typical 8mm tape 65 cartridge holds 5.0GB or 10GB in compressed mode. 66 67 68 Use command: % ufsrestore -if /dev/rmt/0n 69 to retrieve a file from a 'dump' tape later on. The ufsrestore command is 70 convenient to use, see manual pages. 71 }}} 72 {{{ 55 === Sample script to dump a file system to tape === 56 Script below copies four file systems to the same tape. A typical 8mm tape 57 cartridge holds 5.0GB or 10GB in compressed mode. 58 {{{ 59 Use command: % ufsrestore -if /dev/rmt/0n 60 to retrieve a file from a 'dump' tape later on. The ufsrestore command is 61 convenient to use, see manual pages. 62 73 63 #! /bin/csh 74 64 #
