Cov txheej txheem:

Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab: 9 Cov Kauj Ruam
Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab: 9 Cov Kauj Ruam

Video: Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab: 9 Cov Kauj Ruam

Video: Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab: 9 Cov Kauj Ruam
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla использовать для? 2024, Kaum ib hlis
Anonim
Yuav Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab
Yuav Yooj Yim Li Cas Thiaj Li Thaub Koj Lub Linux Box Siv Rdiff-thaub qab

Cov lus qhia no yuav qhia koj yuav ua li cas thiaj li ua tau yooj yim tag nrho tshwj xeeb thaub qab thiab rov qab ua haujlwm ntawm linux siv rdiff-thaub qab thiab usb tsav.

Kauj ruam 1: Kev xav

Kev xav
Kev xav

Kuv tab tom xav tias yog lub kaw lus uas siv yum rau kev teeb tsa thiab tau teeb tsa koj lub USB tsav li /mnt//backup. Kuv siv fedora, tab sis koj tuaj yeem siv txhua yam thiab tsuas yog nruab rdiff-thaub qab txawm li cas los koj xav tau. Nws kuj tseem muaj los ntawm rub tawm ntawm no:

Kauj ruam 2: Nruab Rdiff-thaub qab

Nruab Rdiff-thaub qab
Nruab Rdiff-thaub qab

Nruab rdiff-thaub qab [hauv paus@HOST cov ntawv sau]# yum nruab rdiff-thaub qab

Kauj ruam 3: Txheeb xyuas Cov Ntawv Teev Npe Koj Xav Rov Qab

Txheeb xyuas Cov Ntawv Qhia Koj Xav Rov Qab
Txheeb xyuas Cov Ntawv Qhia Koj Xav Rov Qab

Koj tuaj yeem thaub qab tag nrho cov kab ke, tab sis qhov ntawd tej zaum yuav overkill, Kuv xav backup kuv /etc /directory rau txhua qhov kev hloov pauv uas kuv yuav tau ua rau npe, xa ntawv, network, thiab lwm yam, /cov ntaub ntawv thiab kuv lub tsev dirs.

Kauj ruam 4: Automate

Automate
Automate

Kom meej meej koj tsis xav ua qhov no los ntawm txhais tes. Peb yuav sau ib tsab ntawv. Thawj qhov hauv tsab ntawv, peb yuav tshuaj xyuas kom pom lub USB tsav tau teeb tsa, thiab txiav tawm yog tias tsis yog. #!/bin/bash#Tsab ntawv rau thaub qab rau usb driveBACKUPBASE = "/thaub qab"#xyuas kom pom tias lub hom phiaj thaub qab tau teeb tsa.if `df -h | grep $ BACKUPBASE>/dev/null `tom qab ntawd ncha" Pib $ 0 `date`" lwm qhov ncha "YOOJ YIM: $ BACKUPBASE tsis tau teeb tsa" ncha "$ 0 tawm` hnub `` tawm 1fi

Kauj Ruam 5: Sau Txoj Haujlwm

Sau Ib Leeg
Sau Ib Leeg

Tom ntej no peb yuav sau txoj haujlwm los ua qhov thaub qab. muaj nuj nqi thaub qab {DEST = $ 1 $ 2 SOURCE = $ 2 ncha "Src: $ SOURCE" yog [-d $ DEST] ces ncha "Dest: $ DEST" ntxiv mkdir -p $ DEST echo "Dest: $ DEST -created" OPTS = " --force "fi #Perform backup rdiff-backup -v2 --exclude-special-files $ OPTS $ SOURCE $ DEST #Cleanup version cov ntaub ntawv laus dua 4weeks rdiff-backup -v2-tshem tawm-laus-tshaj 4W --force $ DEST #Luam tawm tsab ntawv ceeb toom ntawm yam peb tau txhawb nqa thiab ntxuav rdiff-thaub qab-npe-hloov-txij li 0D23h00m $ DEST}

Kauj Ruam 6: Ua Qhia Rau Tsab Ntawv Uas Dirs Yuav Rov Qab

Qhia Cov Ntawv Uas Dirs Yuav Rov Qab
Qhia Cov Ntawv Uas Dirs Yuav Rov Qab

backup $ BACKUPBASE /databackup $ BACKUPBASE /etcbackup $ BACKUPBASE /usr /localbackup $ BACKUPBASE /tsev

Kauj Ruam 7: Txhua Yam Ua Ke Tam Sim No

Txhua Yam Ua Ke Tam Sim No
Txhua Yam Ua Ke Tam Sim No

#!/bin/bash#Tsab ntawv rau thaub qab rau usb driveBACKUPBASE = "/thaub qab"#Txheeb xyuas seb puas thaub qab tsav tsheb tau teeb tsa. yog `df -h | grep $ BACKUPBASE>/dev/null `tom qab ntawd ncha" Pib $ 0 `date`" lwm qhov ncha "YOOJ YIM: $ BACKUPBASE tsis tau teeb tsa" ncha "$ 0 tawm` date` "tawm 1fifunction backup {DEST = $ 1 $ 2 SOURCE = $ 2 echo" Src: $ SOURCE "yog [-d $ DEST] ces ncha" Dest: $ DEST "lwm qhov mkdir -p $ DEST echo" Dest: $ DEST -created "OPTS ="-quab yuam "fi #Perform backup rdiff-backup -v2 --exclude-tshwj xeeb-cov ntaub ntawv $ OPTS $ SOURCE $ DEST #Cleanup version cov ntaub ntawv laus dua 4weeks rdiff-thaub qab -v2-tshem tawm-laus-ntau dua 4W-yuam $ DEST #Luam tawm tsab ntawv ceeb toom ntawm yam peb tau txhawb nqa thiab ntxuav rdiff-backup -list-pauv-txij li 0D23h00m $ DEST} thaub qab $ BACKUPBASE /databackup $ BACKUPBASE /etcbackup $ BACKUPBASE /usr /localbackup $ BACKUPBASE /tsev

Kauj ruam 8: Ntxiv rau Cron

Ntxiv rau Cron
Ntxiv rau Cron

[hauv paus@HOST cov ntawv sau]# crontab -e10 1 * * * /usr/local/scripts/backup-rdiff.sh> /var/log/backup.log 2> & 1

Kauj ruam 9: Restore

Restore
Restore

Txhawm rau rov kho cov ntawv tshiab tshaj plaws koj tuaj yeem yooj yim luam cov ntawv tawm ntawm cov npe khaws cia. Yog tias koj xav tau qhov hloov pauv los ntawm 2 hnub dhau los: rdiff -backup -r 2D /backup/etc/named.conf /etc/named.confSimple thiab muaj txiaj ntsig zoo.

Pom zoo: