From: Joe Z. <jz...@us...> - 2003-02-03 06:01:50
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv11597 Modified Files: INSTALL Log Message: I last edited with 'pico' and everything got wrapped weird. Index: INSTALL =================================================================== RCS file: /cvsroot/bobs/bobs/INSTALL,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- INSTALL 3 Feb 2003 05:49:52 -0000 1.17 +++ INSTALL 3 Feb 2003 06:01:47 -0000 1.18 @@ -45,21 +45,16 @@ ::: 3.1 Rsync -On the machine to be backed up, you need to enable 'rsync'. Rsync -will be +On the machine to be backed up, you need to enable 'rsync'. Rsync will be used to transfer the files from the production computer to the backup computer. From the rsync man page: - "The rsync remote-update protocol allows rsync to transfer -just the - differences between two sets of files across the network -link, using an - efficient checksum-search algorithm described in the -technical report that - accompanies this package." + "The rsync remote-update protocol allows rsync to transfer just + the differences between two sets of files across the network link, + using an efficient checksum-search algorithm described in the + technical report that accompanies this package." -First, setup the directories to be backed up by defining them in the -rsync +First, setup the directories to be backed up by defining them in the rsync configuration file. Rsync setup example (/etc/rsyncd.conf): @@ -72,43 +67,33 @@ comment = Produktions share --- end example --- -The uid and gid make rsync run as root which gives permission to read -all -files. Not always needed and not recommended. Look at the rsync -manpage for -more information. +The uid and gid make rsync run as root which gives permission to read all +files. Not always needed and not recommended. Look at the rsync manpage +for more information. Second, enable rsync to run as a daemon. You can run 'ntsysv' or -'chkconfig' -to enable rsync. Then start the rsync daemon. On my RadHat system, -the -command is: +'chkconfig' to enable rsync. Then start the rsync daemon. On my RadHat +system, the command is: /etc/init.d/xinetd restart ::: 3.2 NFS -NFS is a network file system. It will allow the computer doing the -backup to -mount directories on the computer to be backed up. NFS needs to be -enabled in -the linux kernel or as a module. It's probably enabled by default on -RedHat, -but if it's not, then you'll need to go through the steps to rebuild -your -kernel to enable it. This is true for both computers involved. +NFS is a network file system. It will allow the computer doing the backup +to mount directories on the computer to be backed up. NFS needs to be +enabled in the linux kernel or as a module. It's probably enabled by +default on RedHat, but if it's not, then you'll need to go through the +steps to rebuild your kernel to enable it. This is true for both computers +involved. -On the computer to be backed up, nfs and portmap need to be running. -Use +On the computer to be backed up, nfs and portmap need to be running. Use 'ntsysv' or 'chkconfig' to enable them. If you want to start them -manually, -this is how: +manually, this is how: /etc/init.d/portmap start /etc/init.d/nfs start -On the computer that will be doing the backup, only portmap needs to -be +On the computer that will be doing the backup, only portmap needs to be running. nfs setup example (/etc/exports): @@ -117,22 +102,20 @@ 192.168.1.217(rw,no_subtree_check,all_squash,anonuid=501,anongid=501) --- end example --- -The ip address defines which computers can access the share. -"anonuid" and "anongid" controls who owns the files written to the -share. -Look at the "exports" manpage for more information about nfs +The ip address defines which computers can access the share. "anonuid" and +"anongid" controls who owns the files written to the share. Look at the +"exports" manpage for more information about nfs. ::: 4.0 Configuration -Edit the file "inc/config.php" to suit your needs. - The dirs you define there are base dirs for servers you wish to -make backups of. + +Edit the file "inc/config.php" to suit your needs. The dirs you define +there are base dirs for servers you wish to make backups of. backupdir = a mirror of the remote server incomingdir = temp files. Placed here for automatic inclusion in incremental - incrementdir = + incrementdir = dir are created in the base dirs acording to a naming scheme. - eg. backupdir/<servername>/<sharename>/<files of the remote -server> + eg. backupdir/<servername>/<sharename>/<files of the remote server> You'll need to place some files and directories at special locations. (insert neat install script here) @@ -142,8 +125,7 @@ Backupdir/process/cmd/ Backupdir/process/session/ Backupdir/process/mounts/ - All dirs should be read and writeable for the apache(webserver) -process + All dirs should be read and writeable for the apache(webserver) process. Place the file "bash/cmdloop" in "Backupdir/process/" (check the file to see if the program paths fit your system) @@ -153,12 +135,11 @@ example entry in crontab: 0-59/5 * * * * root /var/www/html/bobs/cron/check_loop & -The cmdloop is a command queue. It checks the contents of the "cmd" -dir and executes the files in it. -It allows for shell scripts which might take hours to complete to be -started be from php (and run as root). -Unfortunatly php cannot run as a deamon and a "plugin" to apache at -the same time, so I choose this way. +The cmdloop is a command queue. It checks the contents of the "cmd" dir +and executes the files in it. It allows for shell scripts which might take +hours to complete to be started be from php (and run as root). +Unfortunatly php cannot run as a deamon and a "plugin" to apache at the +same time, so I choose this way. Now you need to create a server config. Open a browser and point it at http://yourbackupserver/admin.php @@ -171,48 +152,43 @@ starts backups. Don't run it yet. -In the inc/excludes/ dir there is a file called -"default.excludelist". -This file contains the names of the files and dirs excluded from -rsync backup. Take a look a the rsync documentation to see the -precise format of this file. -BOBS in its current state checks for a file called -<servername>.<sharename> in that dir. If it is not found it will use -the "default.excludelist" file. -To backup ALL files with no exclusions you should create an empty -file called <servername>.<sharename>. -Consider that users will restore files and then BOBS will make backup -of those files again. Currently a dir called "restore_files" is -created on the users share, and restored files are placed in it. -Default settings excludes that dir from the backup process. +In the inc/excludes/ dir there is a file called "default.excludelist". +This file contains the names of the files and dirs excluded from rsync +backup. Take a look a the rsync documentation to see the precise format of +this file. BOBS in its current state checks for a file called +<servername>.<sharename> in that dir. If it is not found it will use the +"default.excludelist" file. To backup ALL files with no exclusions you +should create an empty file called <servername>.<sharename>. Consider that +users will restore files and then BOBS will make backup of those files +again. Currently a dir called "restore_files" is created on the users +share, and restored files are placed in it. Default settings excludes that +dir from the backup process. ::: 5.0 Test your setups mount the nfs shares, try to write a file. - example of a mount command: mount servername:/home/username -/mnt/test + example of a mount command: mount servername:/home/username /mnt/test rsync a dir. - check if you can see the rsync shares: rsync servername:: - check if your can rsync a file: rsync -a servername::share/file -/tmp/file + check if you can see the rsync shares: + rsync servername:: + check if your can rsync a file: + rsync -a servername::share/file /tmp/file You need to test the cmdloop script. Become root: 'su'. - Go to the cmdloop location (<backupdir>/current/process/) and -type ./cmdloop - It will output lines from running command so it is a good thing -to keep an eye on if things misbehave. - If you need to debug a script (to fix it or send me a bug -report) you can just stop the cmdloop and run the commands in cmd/ -yourself. - Just remeber to run them in the right order (smallest number -first). + Go to the cmdloop location (<backupdir>/current/process/) and type + ./cmdloop + It will output lines from running command so it is a good thing to + keep an eye on if things misbehave. + If you need to debug a script (to fix it or send me a bug report) you + can just stop the cmdloop and run the commands in cmd/ yourself. + Just remeber to run them in the right order (smallest number first). - in another shell start the cron/backup.php script + In another shell start the cron/backup.php script "php <path to script>/backup.php" - If you don't get any errors from the cmdloop output your can stop -it (ctrl-x) + If you don't get any errors from the cmdloop output your can stop it + (ctrl-x) ::: 6.0 Off you go |