From: Joe Z. <jz...@us...> - 2003-02-03 05:49:55
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv8565 Modified Files: TODO INSTALL Log Message: Add recent changes to instructions. Index: TODO =================================================================== RCS file: /cvsroot/bobs/bobs/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TODO 22 Oct 2002 18:51:10 -0000 1.9 +++ TODO 3 Feb 2003 05:49:52 -0000 1.10 @@ -34,6 +34,11 @@ Priority: Medium Admins need to be able to test if a setup works. +Add security. + Priority: Medium + Backup directories (/var/bobsdata/) should not be world readable. + Encrypt passwords. + ----- WISHLIST ------ (Add anything you would like to see in the future, in detail if possible) Index: INSTALL =================================================================== RCS file: /cvsroot/bobs/bobs/INSTALL,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- INSTALL 1 Dec 2002 03:13:19 -0000 1.16 +++ INSTALL 3 Feb 2003 05:49:52 -0000 1.17 @@ -1,9 +1,10 @@ Installation guide. -Latest update June 3. 2002. +Latest update February 2, 2003. -PLEASE NOTE: This is NOT a secure program. Do not deploy if you have security concerns. (you can test it and see for yourself) +PLEASE NOTE: This is NOT a secure program. Do not deploy if you have +security concerns. (you can test it and see for yourself) Overview: @@ -13,8 +14,9 @@ 4.0 Configuration of backupserver 5.0 Test your setup 6.0 Off you go -7.0 Easy install (work in progress) +7.0 Easy install 8.0 Problems +9.0 What gets installed? ::: 1.0 Requirements You'll need at least the following programs installed. @@ -31,27 +33,33 @@ samba ::: 2.0 Files -Changes were recenly made to remove the need for BOBS to reside in the www root folder. +Changes were recently made to remove the need for BOBS to reside in +the www root folder. You should be able to place BOBS in any webaccesible dir. ::: 3.0 Configuration of other servers. You'll need to configure the servers you wish to get files from. -Rsync is needed for backup purposes. -NFS is needed for restoring files. +Rsync or samba is needed for backup purposes. +NFS or samba is needed for restoring files. ::: 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 + "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): @@ -64,51 +72,67 @@ 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 +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 +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: /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 +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 -'ntsysv' or 'chkconfig' to enable them. If you want to start them manually, +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: /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): --- start example --- -/home/produktion 192.168.1.217(rw,no_subtree_check,all_squash,anonuid=501,anongid=501) +/home/produktion +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. +"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. + 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 + incomingdir = temp files. Placed here for automatic inclusion in +incremental 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) @@ -118,69 +142,97 @@ 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) -When you have completed the setup and tests below you should place an entry in /etc/crontab that runs "cron/check_loop" every 5 minutes. - example entry in crontab: 0-59/5 * * * * root /var/www/html/bobs/cron/check_loop & +When you have completed the setup and tests below you should place an +entry in /etc/crontab that runs "cron/check_loop" every 5 minutes. + 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 Enter the password you wrote in config.php Fill out "servername" and "share" and press "create". - Edit the settings and commit them. (remember to make the server "active") + Edit the settings and commit them. (remember to make the server +"active") -Edit the cron/backup.php to suit your setup. This is the command that starts backups. Don't run it yet. +Edit the cron/backup.php to suit your setup. This is the command that +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. +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 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 "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 -Copy the cron/backup.php script into /etc/cron.daily/ to make a backup every night (depending on your settings ofcourse) +Copy the cron/backup.php script into /etc/cron.daily/ to make a +backup every night (depending on your settings ofcourse) Add the check_loop entry to crontab when you are sure all works. Otherwise just keep shell open where you manually run "cmdloop" (I have yet to see it die, but it will not start up if you reboot.) -if you add the entry to the crontab after starting "cmdloop" manually you'll be covered in case your dies. +if you add the entry to the crontab after starting "cmdloop" manually +you'll be covered in case your dies. -You might want to delete the files in session/ sometimes. This is not done automatically yet (but will be at some point). +You might want to delete the files in session/ sometimes. This is not +done automatically yet (but will be at some point). ---- -Please report all bugs. Make suggestions. Send patches. Make better documentation, and PLEASE correct any spellling errors I've made ;-) +Please report all bugs. Make suggestions. Send patches. Make better +documentation, and PLEASE correct any spellling errors I've made ;-) Damn .. this needs an installer script. @@ -191,85 +243,131 @@ http://bobs.sourceforge.net/ ::: 7.0 Easy install -These steps use the standard make utility to automate the install process. This is still -a work in progress. + +These steps use the standard make utility to automate the install process. Easy install steps: 1. Unpack your distribution - cd to the directory containing the bobs tar file bobs-x.x.tar.gz + cd to the directory containing the bobs tar file + 'bobs-x.x.x.tar.gz'. Extract the tarball: tar -xzf bobs-x.x.tar.gz -2. Configure bobs for your system +2. Configure bobs. + + cd to the bobs directory: + + cd bobs-x.x.x + + Configure bobs for your system: ./configure - If you want to specify your own locations, instead of the defaults, for - the bobs web pages and data backup directories, use options to ./configure. - Type './configure --help' for a list of options, the last two are the only - ones you need be concerned with: + If you want to specify your own locations, instead of the + defaults, for the bobs web pages and data backup directories, use + options to ./configure. Type './configure --help' for a list of + options, the last three are the only ones you need be concerned + with: - --with-webdir=DIR Place the bobs web pages in DIR - --with-bobsdata=DIR Place the bobs data (backups) in DIR + --with-webdir=DIR Place the bobs web pages in DIR + --with-bobsdata=DIR Place the bobs data (backups) in DIR + --with-crondir=DIR Location of cron.daily directory - For example, if you want your web pages placed in /home/fred/public_html, - use '--with-webdir=/home/fred/public_html'. This will create directory + For example, if you want your web pages placed in + /home/fred/public_html, use + '--with-webdir=/home/fred/public_html'. This will create directory /home/fred/public_html/bobs containing the bobs web pages. If you want your backup data in /var/local/backup, use '--with-bobsdata=/var/local/backup'. This will create directory /var/local/backup/bobsdata containing all the bobs backups. - The default web directory is /home/httpd/html, or /var/www/html, depending - on your distribution. + The default web directory is /home/httpd/html, or /var/www/html, + depending on your distribution. The default data directory is /var/bobsdata. FIXME: - ./configure will also store a plain text password in inc/config.php. - This password will control access to the bobs/admin.php web page. + ./configure will also store a plain text password in + inc/config.php. This password will control access to the + bobs/admin.php web page. -3. After running ./configure, run +3. Install bobs + + Change to root: + + su + + Install the files: make install - This will copy the web pages and create the backup data directories. + This will install the web pages, create the backup data + directories, and add a cron job to /etc/crontab. FIXME: - You should now change the bobs admin password. The password defaults - to 'admin'. Open the file inc/config.php and change the value of the - admin_pwd variable. + You should now change the bobs admin password. The password + defaults to 'admin'. Open the file config.php and change the + value of the admin_pwd variable. By default, config.php will be in + /var/www/html/bobs/inc/config.php. 4. If you want to uninstall bobs, or change your configuration: - Run 'make uninstall' to remove the bobs web pages and delete the backup data - directories. You can then run ./configure and 'make install' again. + Run 'make uninstall' to remove the bobs web pages and delete the + backup data directories. You can then run ./configure and 'make + install' again. - Run 'make clean' before running ./configure a second time to ensure the reconfiguration - of all options. + You may run 'make clean' before running ./configure a second time to + ensure the reconfiguration of all options. -5. If you have trouble with the ./configure script, you can rebuild it by running - these commands from the bobs distribution directory: + If you have trouble with the ./configure script, you can + rebuild it by running these commands from the bobs distribution + directory: make distclean aclocal - autoconf automake --add-missing + autoconf ./configure +5. Bobs is now installed. + + Point your browser to http://localhost/bobs/admin.php to configure + your backup servers. + ::: 8.0 Problems -If your having trouble, read this section. -First, make sure these services are running on the host computer (the one with -bobs installed). See section 3 for more information. +If you're having trouble, read this section. + +First, make sure these services are running on the host computer (the one +with bobs installed). See section 3 for more information. portmap httpd (web server) -Second, make sure these services are running on the computer to be backed up. +Second, make sure these services are running on the computer to be backed +up. portmap nfs +::: 9.0 What gets installed? + +/var/bobsdata Directory for backup and configuration data + +/var/www/html/bobs Bobs web pages + +/etc/crontab A line is added to /etc/crontab that + checks/starts the backup command loop script. + 0-59/5 * * * * root /var/bobsdata/current/process/check_loop + +'make uninstall' and 'make uninstall-all' will remove the files and +directories listed above, including the check_loop entry in crontab. + +'make uninstall' will not remove any server configurations or backups you +created since installing bobs. But 'make uninstall-all' WILL remove all +the files and directories, including any backups. So only run 'make +uninstall-all' if you want to completely remove bobs and all backups +created by bobs. |