Создание файлов резервных копий

Создание файлов резервных копий



Содержание статьи:

dump

Dump tar; . . Dump ext2, , , . . , , . Dump . restore dump; . . . dump .

Dump

Dump . 0 9, 0 , , . 0 , dump . , . ? :

 0    3    2     5     4      7     6      9      8       9 |    |    |     |     |      |     |      |      |       | 0        |     |      |      |    |     |     |      |     |      |      |       |   3        0  3.      |    |     |     |      |     |      |      |        2        0  2.           |     |     |      |     |      |      |           5        0, 3  5.                 |     |      |     |      |      |               4        0, 3  4.                 |     |      |     |      |                    7        0, 3, 4  7.                       |      |     |      |                       6        0, 3, 4  6.                       |      |     |                          9        0, 3, 4, 6  9.                              |     |                                 8        0, 3, 4, 6  8.                                    |                                    9        0, 3, 4, 6, 8  9.  

, . , . , . , , . dump , : 3, 2, 5, 4, 7, 6, 9, 8, 9 , . .

()
1 0 1
2 3 1 1,2
3 2 2 1,3
4 5 1 1,2,4
5 4 2 1,2,5
6 7 1 1,2,3,6
7 6 2 1,2,5,7
8 9 1 1,2,5,7,8
9 8 2 1,2,5,7,9
10 9 1 1,2,5,7,9,10

dump

, dump. , , , . , , (/home) (/dev/st0). 0 , :

  • 1, ( 1 ).
    [root@deep /]# dump -0u -f /dev/st0 /home
    DUMP: Date of this level 0 dump: Fri Jan 28 21:25:12 2000
    DUMP: Date of last level 0 dump: the epoch
    DUMP: Dumping /dev/sda6 (/home) to /dev/st0
    DUMP: mapping (Pass I) [regular files]
    DUMP: mapping (Pass II) [directories]
    DUMP: estimated 18582 tape blocks on 0.48 tape(s).
    DUMP: Volume 1 started at: Fri Jan 28 21:25:14 2000
    DUMP: dumping (Pass III) [directories]
    DUMP: dumping (Pass IV) [regular files]
    DUMP: DUMP: 18580 tape blocks on 1 volumes(s)
    DUMP: finished in 4 seconds, throughput 4645 KBytes/sec
    DUMP: Volume 1 completed at: Fri Jan 28 21:25:18 2000
    DUMP: Volume 1 took 0:00:04
    DUMP: Volume 1 transfer rate: 4645 KB/s
    DUMP: level 0 dump on Fri Jan 28 21:25:12 2000
    DUMP: DUMP: Date of this level 0 dump: Fri Jan 28 21:25:12 2000
    DUMP: DUMP: Date this dump completed: Fri Jan 28 21:25:18 2000
    DUMP: DUMP: Average transfer rate: 4645 KB/s
    DUMP: Closing /dev/st0
    DUMP: DUMP IS DONE
  • , ( 2 ).
    [root@deep /]# dump -3u -f /dev/st0 /home
  • , ( 3 ).
    [root@deep /]# dump -2u -f /dev/st0 /home
  • , ( 4 ).
    [root@deep /]# dump -5u -f /dev/st0 /home
  • , ( 5 ).
    [root@deep /]# dump -4u -f /dev/st0 /home
  • 2, ( 6 ).
    [root@deep /]# dump -7u -f /dev/st0 /home
  • , ( 2 ).
    [root@deep /]# dump -3u -f /dev/st0 /home
  • , ( 3 ).
    [root@deep /]# dump -2u -f /dev/st0 /home
  • , ( 4 ).
    [root@deep /]# dump -5u -f /dev/st0 /home
  • , ( 5 ).
    [root@deep /]# dump -4u -f /dev/st0 /home
  • 3, ( 7 ).
    [root@deep /]# dump -6u -f /dev/st0 /home
  • , ( 2 ).
    [root@deep /]# dump -3u -f /dev/st0 /home
  • , ( 3 ).
    [root@deep /]# dump -2u -f /dev/st0 /home
  • , ( 4 ).
    [root@deep /]# dump -5u -f /dev/st0 /home
  • , ( 5 ).
    [root@deep /]# dump -4u -f /dev/st0 /home
  • 4, ( 8 , ).
    [root@deep /]# dump -9u -f /dev/st0 /home
  • , ( 2 , ).
    [root@deep /]# dump -3u -f /dev/st0 /home
  • , ( 3 , ).
    [root@deep /]# dump -2u -f /dev/st0 /home
  • , ( 4 , ).
    [root@deep /]# dump -5u -f /dev/st0 /home
  • , ( 5 , ).
    [root@deep /]# dump -4u -f /dev/st0 /home
  • , ( , ).
    [root@deep /]# dump -0u -f /dev/st0 /home

-0 -9 , , u /etc/dumpdates , -f ; , , /dev/st0 ( ), /dev/rsd1c ( ), , — ( ). , , , . /home. , 2 5 ( = 4 ), 6, 7 8 ( , 6 + 7 + 8 = 3 ; , ), 1 ( , 1 + 11 = 12 ). , 8 (4 + 3 + 1 = 8), 8 11 , 1- . , , , , . , 12 12 , . , 12 , , (12 ) .

dump

restore dump(8). dump. , . . , dump. , restore . . , restore shell , , , . , , , /home:

, , . , restore , .

, ( /home ) :

[root@deep /]# cd /home

:

[root@deep /home]# restore -i -f /dev/st0
restore >

, ls:

restore > ls
.:
admin/ lost+found/ named/ quota.group quota.user wahib/

restore >

cd ( , wahib):

restore > cd wahib
restore > ls
./wahib:
.Xdefaults .bash_logout .bashrc
.bash_history .bash_profile Personal/

restore >

add ( , ):

restore > add Personal/ restore >

, *, ls:

restore > ls
./wahib:
.Xdefaults .bash_logout .bashrc
.bash_history .bash_profile *Personal/

delete ( , ):

, .

restore > cd Personal/
restore > ls
./wahib/Personal:
*Ad?le_Nakad.doc *Overview.doc
*BIMCOR/ *Resume/
*My Webs/ *SAMS/
*Contents.doc *Templates/
*Divers.doc *bruno universite.doc
*Linux/ *My Pictures/

restore > delete Resume/
restore > ls
./wahib/Personal:
*Ad?le_Nakad.doc *Overview.doc
*BIMCOR/ Resume/
*My Webs/ *SAMS/
*Contents.doc *Templates/
*Divers.doc *bruno universite.doc
*Linux/ *My Pictures/

extract (Restore . ):

restore > extract
You have not read any tapes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for ‘.’? [yn] y

restore quit.

/sbin/restore > quit

. dump (man).

:

$ man dump (8) ext2
$ man restore (8) — » dump»

. . , . , . , (/home), .

. , . , . , , .

, . , :

, tar dump , . . , rmt rsh. rmt dump tar. rsh , , (rsh, rlogin rcp).

rsh , rmt rsh, ( 2, Linux ). . SSH ( 11, ), scp . SSH , tar dump , scp.

SSH scp

scp . SSH , , SSH. rcp rsh, scp . , , tar; , dump .

:

[admin@deep /]# scp <localdir/to/filelocation> <user@host:/dir/for/file>

<localdir/to/filelocation> — , <user@host:/dir/for/file> , , (user) , , (host), , .

:

[admin@deep /]# scp -Cp /backups/deep-01Feb.tar admin@backupserver:/archive/deep/deep-01Feb.tar
admin@backupserver’s password:
deep-01Feb.tgz | 10479 KB | 154.1 kB/s | ETA: 00:00:00 | 100%

. C , p , , , . , dir/for/file (/archive/deep ) username, scp (admin ) :
scp: /archive/deep/deep-01Feb.tar: Permission denied.

:

[admin@deep /]# scp <user@host:/dir/for/file> <localdir/to/filelocation>

<user@host:/dir/for/file> , , (user) , , (host), , , , <localdir/to/filelocation> — , . :

[admin@deep /]# scp -Cp admin@backupserver:/archive/deep/deep-01Feb.tar /backups
admin@backupserver’s password:
deep-01Feb.tgz | 10479 KB | 154.1 kB/s | ETA: 00:00:00 | 100%

tar dump

AMANDA
AMANDA: http://www.cs.umd.edu/projects/amanda/

BRU
BRU: http://www.bru.com/




Источник: linux.yaroslavl.ru


Добавить комментарий