⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 howto

📁 一套客户/服务器模式的备份系统代码,跨平台,支持linux,AIX, IRIX, FreeBSD, Digital Unix (OSF1), Solaris and HP-UX.
💻
📖 第 1 页 / 共 5 页
字号:
To use a media changer, a driver program must be available. On manyarchitectures mtx can be used. On the Sun under Solaris-2 the stctlpackage is very useful. On FreeBSD chio seems to be the preferredtool. Another driver available for Linux is the sch driver comingtogether with the mover command (See changer.conf.sch-mover for alink). Check the documentation of either package how to use them.Changer configuration files for these four are coming with theafbackup distribution (changer.conf.mtx, changer.conf.stctl,changer.conf.chio and changer.conf.sch-mover), they should workimmediately with the most changers. mtx and stctl can be obtainedfrom the place, afbackup has been downloaded from.Very short:mtx uses generic SCSI devices (e.g. /dev/sg0 ... on Linux), stctlships a loadable kernel module, that autodetects changer devicesand creates device files and symlinks /dev/rmt/stctl0 ... in thedefault configuration. With stctl it is crucial to write enoughtarget entries to probe into the /kernel/drv/stctl.conf file.Note, that the attached mtx.c is a special implementation i wasnever able to test myself. It is quite likely, that it behavesdifferently than the official mtx, so it will not work with theattached changer.conf.mtx file. The mover command also comes witha kernel driver called sch.If the driving command is installed and proven to work (play arounda little with it), the configuration file for it must be created.It should reside in the same directory like the serverside configfile, but this is arbitrary. The path to the file must be givenin the server configuration file as parameter like this example:Changer-Configuration-File:     %C/changer.conf%C will be replaced with the path to the confdir of the server side.See the manual pages of the cart_ctl command about what this filemust contain.Now the device entry in the server configuration must be extended.The new format is:<streamerdevice>[=<drive-count>]@<device>#<num-slots>[^<num-loadbays>]Whitespace is allowed between the special characters for readability.An example:/dev/nst0 @ /dev/sg0 # 20This means: Streamer /dev/nst0 is attached to media handler at /dev/sg0,which has 20 slots. The part = <drive-count> is optional. It must beset appropriately, if the streamer is not in position 1 in the changer.(Note, that with cart_ctl every count starts with 1, independent of the underlaying driver command. This abstraction is done in the configuration).^ <num-loadbays> is also optional and must not be present, if the changerdoes not have any loadbay. A full example:/dev/nst1 = 2 @ /dev/sg0 # 80 ^ 2If is recommended to configure a lockfile for the changer with fullpath, too. For example:Changer-Lockfile:        /var/adm/backup/changer.lockTo check the configuration now the command cart_ctl should be run,simply with option -l. An empty list of cartridge locations shouldbe printed, just the header should appear. Now the backup systemshould be told, where the cartridges currently are. This is doneusing the option -P of cart_ctl. To tell the system, that the tapes10-12 are in slot 1-3 and tapes 2-4 in slot 4-6, enter:cart_ctl -P -C 10-12,2-4 -S 1-6Verify this with cart_ctl -l . To tell the system, that Tape 1 is inthe drive 1, enter:cart_ctl -P -C 1 -D 1(The drive number 1 is optional, as this is the default)Optionally the system can store locations for all cartridges notplaced inside any changer. A free text line can be given with the-P option, what might be useful, for example:cart_ctl -C 5-9,13-20 -P 'Safe on 3rd floor'To test the locations database, one might move some cartridges around,e.g. cartridge 3 into the drive (assumed tape 6 is in some slot andthe location has been told to the system as explained above):cart_ctl -m -C 3 -DLoad another cartridge to drive, it will be automatically unloaded toa free slot, if the List-free-slots-command in the configuration worksproperly.Instead of telling the system, what tapes are located in the slots,one might run an inventory, what makes them all to be loaded intothe drive and the labels to be read. To do this, enter:cart_ctl -i -S 1-6For further information about the cart_ctl command, refer to themanual pages.To make the server also use the cart_ctl command for loading tapes,the SetCartridgeCommand in the server configuration must be set asfollows:Setcart-Command:  %B/cart_ctl -F -m -C %n -DThe parameter Cartridge-Handler must be set to 1 .Now the whole thing can be tested making the server load a tape froma client command:/path/to/client -h serverhost [ -p serverport ] -C 4Cartridge 4 should be loaded to drive now. Try with anothercartridge. If this works, the afbackup server is properlyconfigured to use the changer device. Have fun.--------------------------------------------------------------------------27: How to build Debian packages ?Run the debuild command in the debian subdirectory of the distribution--------------------------------------------------------------------------28: How to let users restore on a host, they may not login to ?Here's one suggestion, how to do that. It uses inetd and thetcpwrapper tcpd on the NFS-server side, where login is not permitted,and the identd on the client, where the user sits. It starts the X11-frontend of afrestore setting the display to the user's host:0.Furthermore required is the ssu (silent su, only for use by thesuperuser, not writing to syslog) program. Source can be obtainedfrom the same download location, where afbackup had been found.It is part of the albiutils package.Perform the following steps:* Add to /etc/services:remote-afbackup		789/tcp(or another unused service number < 1024)* Add to or create the tcpd configuration file /etc/hosts.allow (or similar,  man tcpd ...):in.remote-afbackup : ALL : rfc931 : twist=/usr/sbin/in.remote-afbackup %u %h* Add to /etc/inetd.conf and kill -HUP the inetd:remote-afbackup   stream tcp  nowait  root  /usr/sbin/tcpd  in.remote-afbackup(if the tcpd is not in /usr/sbin, adapt the path. If it's notinstalled: Install it. It makes sense anyway)* create a script /usr/sbin/in.remote-afbackup and chmod 755 :#!/bin/sh## $Id: HOWTO,v 1.1 2004/07/08 20:34:48 alb Exp alb $#  # shell script for starting the afbackup X-frontend remotely through# inetd, to be called using the 'twist' command of the tcp wrapper.# Note: on the client the identd must be running or another RFC931# compliant service#if [ $# != 2 ] ; then   echo Error, wrong number of arguments   exit 0firemuser="$1"remhost="$2"if [ "$remuser" = "" -a "$remuser" = "" ] ; then   echo Error, required argument empty   exit 0fi# check for correct user entry in NISushell=`/usr/bin/ypmatch "$remuser" passwd 2>/dev/null | /usr/bin/awk -F: ' {print $7}'`if [ _"$ushell" = _ -o _"$ushell" = "_/bin/false" ] ; then   echo "You ($remuser) are not allowed to use this service"   exit 0figr=`id "$remuser"| sed 's/^.*gid=[0-9]*(//g' | sed 's/).*$//g'`# check, if group existsypmatch $gr group.byname >/dev/null 2>&1if [ $? -ne 0 ] ; then  echo "Error: group $gr does not exist. Please check"  exit 0fiDISPLAY="$remhost":0export DISPLAY/path/to/ssu "$remuser":$gr -c /usr/local/afbackup/client/bin/xafrestore####### end of script ######* Edit the last line with ssu to reflect the full path to ssu, that you  have built from the albiutils package.Now a user can start the xafrestore remotely by simply:telnet servername 789(or whatever port has been chosen above).For user-friendlyness, this command can be put into a scriptwith an appropriate name.Thanks to Dr. Stefan Scholl at Infineon Techologies for thisconcept and part of the implementation--------------------------------------------------------------------------29: How to backup through a firewall ?Connections to port 2988 (or whatever port the service is assigned)must be allowed in direction towards the server (TCP is used for allafbackup connections). If the multi stream service is to be used,this port must also be open (default 2989, if not changed) in thesame direction.If the remote start option is desired (afclient -h hostname -X ...),connections to the target port 2988 (i.e. afbackup) of the clientnamed with option -h must be permitted from the host, this commandis started on.If the encryption key for the client-server authentication is keptsecret and protected with care on the involved computers, the serverport of afbackup is not exploitable. So it may be connectable by theworld without any security risk. The only non desirable thing, thatmight happen, is a denial of service attack opening high numbers ofconnections to that port. The inetd will probably limit the numberof server programs to be started simultaneously, but clients willno longer be able to open connections to run their backup.The connections permitted through the firewall should in any case berestricted from and to the hosts participating in the backup service.If initiating connections from outside of the firewall is unwanted,an ssh tunnel can be started from the inside network to a machineoutside thus acting as kind of a proxy server. The outside backupclients must be configured to connect the proxy machine for backup,where the TCP port is listening, i.e. the other side of the sshtunnel sees the light of the outside world. It should be quite clear,that ssh tunneling reduces throughput because of the additionalencryption/decryption effort. See the ssh documentation and HOWTO Q11for more information.--------------------------------------------------------------------------30: How to configure xinetd for afbackup ?Here are the appropriate xinetd.conf entries. As long as the convenientway of configuration like with inetd is not included into afbackup,the entries have to be made manually, followed by a kill -USR2 to thexinetd.For the single stream service:service afbackup{        flags           = REUSE NAMEINARGS        socket_type     = stream        protocol        = tcp        wait            = no        user            = backup        server          = /usr/local/afbackup/server/bin/afserver        server_args     = /usr/local/afbackup/server/bin/afserver /usr/local/afbackup/server/lib/backup.conf}For the multi stream service:service afmbackup{        flags           = REUSE NAMEINARGS        socket_type     = stream        protocol        = tcp        wait            = yes        user            = backup        server          = /usr/local/afbackup/server/bin/afmserver        server_args     = /usr/local/afbackup/server/bin/afmserver /usr/local/afbackup/server/lib/backup.conf}Replace the user value with the appropriate user permitted to operatethe device to be used (see: INSTALL).--------------------------------------------------------------------------31: How to redirect access, when a client contacts the wrong server ?This situation might arise, when localhost has been configured andrestore should be done on a different client, but the same server.Or it might happen, that the backup service has moved, no host aliashas been used during backup and it is not possible to rename themachine cannot be renamed.Her

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -