Quick HOWTO : Ch1 : Network Backups With Rancid/zh
文章出处: |
{{#if: | {{{2}}} | http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch1_:_Network_Backups_With_Rancid }} |
点击翻译: |
English {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/af | • {{#if: PHP5|Afrikaans| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ar | • {{#if: PHP5|العربية| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/az | • {{#if: PHP5|azərbaycanca| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/bcc | • {{#if: PHP5|جهلسری بلوچی| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/bg | • {{#if: PHP5|български| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/bg|български]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/br | • {{#if: PHP5|brezhoneg| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ca | • {{#if: PHP5|català| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ca|català]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/cs | • {{#if: PHP5|čeština| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/de | • {{#if: PHP5|Deutsch| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/el | • {{#if: PHP5|Ελληνικά| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/es | • {{#if: PHP5|español| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/es|español]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/fa | • {{#if: PHP5|فارسی| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/fi | • {{#if: PHP5|suomi| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/fr | • {{#if: PHP5|français| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/fr|français]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/gu | • {{#if: PHP5|ગુજરાતી| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/he | • {{#if: PHP5|עברית| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/he|עברית]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/hu | • {{#if: PHP5|magyar| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/id | • {{#if: PHP5|Bahasa Indonesia| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/it | • {{#if: PHP5|italiano| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/it|italiano]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ja | • {{#if: PHP5|日本語| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ko | • {{#if: PHP5|한국어| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ksh | • {{#if: PHP5|Ripoarisch| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/mr | • {{#if: PHP5|मराठी| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ms | • {{#if: PHP5|Bahasa Melayu| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/nl | • {{#if: PHP5|Nederlands| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/no | • {{#if: PHP5|norsk| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/no|norsk]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/oc | • {{#if: PHP5|occitan| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/pl | • {{#if: PHP5|polski| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/pl|polski]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/pt | • {{#if: PHP5|português| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/pt|português]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ro | • {{#if: PHP5|română| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ro|română]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/ru | • {{#if: PHP5|русский| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/ru|русский]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/si | • {{#if: PHP5|සිංහල| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/sq | • {{#if: PHP5|shqip| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/sr | • {{#if: PHP5|српски / srpski| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/sv | • {{#if: PHP5|svenska| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/th | • {{#if: PHP5|ไทย| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/tr | • {{#if: PHP5|Türkçe| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/vi | • {{#if: PHP5|Tiếng Việt| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/yue | • {{#if: PHP5|粵語| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/zh | • {{#if: PHP5|中文| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/zh|中文]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/zh-hans | • {{#if: PHP5|中文(简体)| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: PHP5 | PHP5 | {{#if: | :}}Quick HOWTO : Ch1 : Network Backups With Rancid/zh}}/zh-hant | • {{#if: PHP5|中文(繁體)| [[::Quick HOWTO : Ch1 : Network Backups With Rancid/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:PHP5|:Quick HOWTO : Ch1 : Network Backups With Rancid/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Quick HOWTO : Ch1 : Network Backups With Rancid/zh/zh | | {{#ifexist: Quick HOWTO : Ch1 : Network Backups With Rancid/zh/zh | | {{#ifeq: {{#titleparts:Quick HOWTO : Ch1 : Network Backups With Rancid/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Quick HOWTO : Ch1 : Network Backups With Rancid/zh|1|-1|}} | zh | | }}
简介
一个被网络管理忽略的地方是失败的网络备份硬盘的设置,悲哀的是这只是造成灾难性打击的开始。幸运的是Linux/Unix有一个叫Rancid的开源包,它可以自动地、用命令的方法快速完成为大多数驱动器设置备份这项工作。 这个产品可以从 rancid website里下载得到,在Concurrent Versions System (CVS)中还增加旧的自动归档的好外.这个指南将会给您显示如何快速安装和设置它为你的网络备份需要。
安装Rancid
Under Fedora Linux, installation is relatively easy, but there are a large number of simple steps to follow. Let's begin:
在Fedora Linux 安装的Rancid是十分简单的,但接下来有很多简单的步骤,现在我们开始:
1. Rancid uses the expect programming language to operate which you will have to install in advance. Use the rpm command with the -q qualifier to determine whether you have expect installed. In this case, it isn't so the yum command is used to do so.
[root@bigboy tmp]# rpm -q expect package expect is not installed [root@bigboy rancid-2.3.2a2]# yum -y install expect Repository updates-released already added, not adding again Repository base already added, not adding again Setting up Install Process ... ... ... [root@bigboy rancid-2.3.2a2]#
2) Create a Linux group named netadm which will eventually have access to the Rancid directory.
[root@bigboy tmp]# groupadd netadm
3) Create a user named rancid that will be used to run the network device backups every night. Here we make rancid a member of the netadm group and make /usr/local/rancid its home directory.
[root@bigboy tmp]# useradd -g netadm -c "Networking Backups" -d /usr/local/rancid rancid
4) Create a directory called /usr/local/rancid/tar and use the wget command to get the latest version of the Rancid tar file from its web site.
[root@bigboy tmp]# mkdir /usr/local/rancid/tar [root@bigboy tmp]# cd /usr/local/rancid/tar [root@bigboy tar]# wget ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz --01:14:26-- ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz => `rancid-2.3.2a2.tar.gz' ... ... ... 100%[==============================>] 280,435 153.28K/s 01:14:58 (152.78 KB/s) - `rancid-2.3.2a2.tar.gz' saved [280,435] [root@bigboy tar
5) Rancid needs to be compiled. Next, you will need to extract the files from the Rancid tar file as a pre-compilation step. In this case the file is named rancid-2.3.2a2.tar.gz so the extraction process will place all the preliminary files in a directory named rancid-2.3.2a2.
[root@bigboy tar]# tar -xvzf rancid-2.3.2a2.tar.gz rancid-2.3.2a2/bin/Makefile.am rancid-2.3.2a2/bin/Makefile.in rancid-2.3.2a2/bin/alogin.in ... ... ... rancid-2.3.2a2/man/lg.conf.5.in rancid-2.3.2a2/man/rancid.conf.5.in rancid-2.3.2a2/man/lg_intro.1.in [root@bigboy tar]#
6) Enter the directory.
[root@bigboy tar]# cd rancid-2.3.2a2 [root@bigboy rancid-2.3.2a2]#
7) In this directory there is a README file with instructions on what to do next. You can view it using the less command to see the various configuration options offered. We will proceed in this example by using a very simple scenario.
[root@bigboy rancid-2.3.2a2]# less README
8) Prepare the Rancid package for compiling with the configure command. Here, the --prefix switch is used to set the default directory to match the /usr/local/rancid/ home directory of our rancid user.
[root@bigboy rancid-2.3.2a2]# ./configure --prefix=/usr/local/rancid/ checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk ... ... ... config.status: creating include/config.h config.status: include/config.h is unchanged config.status: executing depfiles commands [root@bigboy rancid-2.3.2a2]#
9) Install the package with the make command.
[root@bigboy rancid-2.3.2a2]# make install Making install in . gmake[1]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2' gmake[2]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2' gmake[2]: Nothing to be done for `install-exec-am'. test -z "/usr/local/rancid//share/rancid" || mkdir -p -- "/usr/local/rancid//share/rancid" ... ... ... /usr/bin/install -c 'downreport' '/usr/local/rancid//share/rancid/downreport' gmake[2]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share' gmake[1]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share' [root@bigboy rancid-2.3.2a2]#
10) There is a sample password file named cloginrc.sample. You'll need to copy it to the /usr/local/rancid/ home directory as the hidden file /usr/local/rancid/.cloginrc.
[root@bigboy rancid-2.3.2a2]# cp cloginrc.sample /usr/local/rancid/.cloginrc [root@bigboy rancid-2.3.2a2]#
11) Finally you will need to set the .cloginrc file permissions to be readable by the rancid user and the new netadm Linux group. You will also have to change the ownership and permissions of the home directory in a similar fashion.
[root@bigboy rancid-2.3.2a2]# chmod 0640 /usr/local/rancid/.cloginrc [root@bigboy rancid-2.3.2a2]# chown -R rancid:netadm /usr/local/rancid/ [root@bigboy rancid-2.3.2a2]# chmod 770 /usr/local/rancid/
Now that the installation is complete, you'll need to do some initial configuration to get Rancid to work. Don't worry, it is fairly straight forward.