Differences

This shows you the differences between the selected revision and the current version of the page.

howto:backuppc 2008/07/06 23:41 howto:backuppc 2017/12/04 19:29 current
Line 1: Line 1:
====== HOWTO Install BackupPC ====== ====== HOWTO Install BackupPC ======
-[[http://backuppc.sourceforge.net/info.html|BackupPC]] is a high-performance, enterprise-grade system for backing up Linux and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.  It runs quite well on the DNS-323.  The accompanying forum thread is located [[http://forum.dsmg600.info/t2264-BackupPC-DNS-323-running-working.html|here]].+[[http://backuppc.sourceforge.net/info.html|BackupPC]] is a high-performance, enterprise-grade system for backing up Linux and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.  It runs quite well on the DNS-323.  The accompanying forum thread is located [[http://forum.dsmg600.info/t2264-BackupPC-DNS-323-running-working.html|here]]. \\ For a Wikipedia description click [[http://en.wikipedia.org/wiki/Backuppc|here]]. 
 + 
===== Requirements ===== ===== Requirements =====
Line 22: Line 24:
    cd /mnt/HD_a2     cd /mnt/HD_a2
    rsync -av inreto.de::dns323/fun-plug/0.5/packages .     rsync -av inreto.de::dns323/fun-plug/0.5/packages .
 +    rsync -av inreto.de::dns323/fun-plug/0.5/extra-packages/All/perl* .
    cd packages     cd packages
    funpkg -i *.tgz     funpkg -i *.tgz
Line 27: Line 30:
This should get all the required programs installed except for BackupPC This should get all the required programs installed except for BackupPC
 +
 +===== Create backuppc user =====
 +Create user and homedirectory
 +
 +  useradd -m backuppc
 +
 +To not lose user by reboot - store password permanently
 +
 +  store-passwd.sh
Line 40: Line 52:
  wget http://search.cpan.org/CPAN/authors/id/C/CB/CBARRATT/File-RsyncP-0.68.tar.gz   wget http://search.cpan.org/CPAN/authors/id/C/CB/CBARRATT/File-RsyncP-0.68.tar.gz
  tar zxvf File-RsyncP-0.68.tar.gz   tar zxvf File-RsyncP-0.68.tar.gz
 +  cd File-RsyncP-0.68/
  perl Makefile.PL   perl Makefile.PL
  make   make
Line 56: Line 69:
  IO::Uncompress::Gunzip   IO::Uncompress::Gunzip
-I don't think this is difficult, just time consuming.+I don't think this is difficult, just time consuming. However, if you're lazy and trust the perl automatic installer, you can run: 
 + 
 +  for N in Compress::Raw::Zlib IO::Compress::Base IO::Compress::Base::Common IO::Compress::Gzip IO::Compress::Gzip::Constants IO::Uncompress::Base IO::Uncompress::Gunzip 
 +    do perl -MCPAN -e "install $N" 
 +  done
Line 79: Line 96:
  Are these paths correct? [y]? y   Are these paths correct? [y]? y
  BackupPC will run on host [...]? your HOSTNAME here (it's probably already the default answer)   BackupPC will run on host [...]? your HOSTNAME here (it's probably already the default answer)
-  BackupPC should run as user [backuppc]? root (it's better to create a limited user named backuppc)+  BackupPC should run as user [backuppc]?
  Install directory (full path) [...]? /ffp/usr/BackupPC   Install directory (full path) [...]? /ffp/usr/BackupPC
  Data directory (full path) []? /ffp/backuppcdata   Data directory (full path) []? /ffp/backuppcdata
Line 110: Line 127:
Another option is to create a startup script and put it in the /mnt/HD_a2/ffp/start/ directory Another option is to create a startup script and put it in the /mnt/HD_a2/ffp/start/ directory
 +
 +The script below works for me, if you use it you should of course NOT add the 2 lines mentioned above to the end of the fun_plug
 +
 +  #!/bin/sh
 + 
 +  # PROVIDE: backuppc
 +  # REQUIRE: DAEMON
 +  # BEFORE:  LOGIN
 +  # KEYWORD: shutdown
 + 
 +  . /ffp/etc/ffp.subr
 + 
 +  name="backuppc"
 +  start_cmd="backuppc_start"
 +  restart_cmd="backuppc_restart"
 +  stop_cmd="backuppc_stop"
 +  status_cmd="backuppc_status"
 + 
 +  backuppc_start()
 +  {
 +      ln -s /mnt/HD_a2/ffp/etc/BackupPC /etc/
 +      # If you run BackupPC under user root you don't need these commented lines,
 +      # otherwise you're smart enough to figure out why I have them in my config ;-)
 +      # ln -s /mnt/HD_a2/ffp/var/log/BackupPC /var/log/
 +      # su - backuppc -s /bin/sh -c '/mnt/HD_a2/ffp/usr/BackupPC/bin/BackupPC -d'
 +      /mnt/HD_a2/ffp/usr/BackupPC/bin/BackupPC -d
 +      echo "${name} started"
 +  }
 + 
 +  backuppc_restart()
 +  {
 +      backuppc_stop
 +      sleep 1
 +      backuppc_start
 +  }
 + 
 +  backuppc_stop()
 +  {
 +      /ffp/bin/pkill -f "/mnt/HD_a2/ffp/usr/BackupPC/bin/BackupPC -d"
 +      echo "${name} stopped"
 +  }
 + 
 +  backuppc_status()
 +  {
 +      if [ "`ps ax | grep "BackupPC -d" | grep perl`" = "" ] ; then
 +          echo "${name} not running"
 +      else
 +          echo "${name} running"
 +      fi
 +  }   
 + 
 + 
 +  extra_commands="status"
 +  run_rc_command "$1"
 +
 +
The last thing we need to do is fix the BackupPC_Admin cgi script to work with lighttpd.  This change isn't exactly necessary if your web server is properly configured, but I found this to be simple enough: The last thing we need to do is fix the BackupPC_Admin cgi script to work with lighttpd.  This change isn't exactly necessary if your web server is properly configured, but I found this to be simple enough:
Line 120: Line 193:
BackupPC is now installed and will run on startup, but it needs to be configured, and we need to fix lighttpd to run the BackupPC_Admin.pl perl file BackupPC is now installed and will run on startup, but it needs to be configured, and we need to fix lighttpd to run the BackupPC_Admin.pl perl file
 +
Line 157: Line 231:
  chmod a+x /mnt/HD_a2/ffp/start/lighttpd.sh   chmod a+x /mnt/HD_a2/ffp/start/lighttpd.sh
-You lighttpd should be good to go now.+Your lighttpd should be good to go now.
You can test it by creating a file, /mnt/HD_a2/www/pages/cgi-bin/sample.pl, that contains: You can test it by creating a file, /mnt/HD_a2/www/pages/cgi-bin/sample.pl, that contains:
Line 169: Line 243:
And you should only see (with no other text!): And you should only see (with no other text!):
  Hi there! This is a sample perl program!!!   Hi there! This is a sample perl program!!!
 +
Line 179: Line 254:
  $Conf{XferMethod} = 'rsyncd';   $Conf{XferMethod} = 'rsyncd';
-Now you need to set up the config files for each host:+Now you need to set up the config files for each host.  First you need to create the directory that the config files will be stored in: 
 + 
 +  mkdir /mnt/HD_a2/ffp/etc/BackupPC/pc/
-So, for a host with the name, computer1, you would edit the file /mnt/HD_a2/ffp/etc/BackupPC/pc/computer1.pl and put in:+Now you are ready to create the config file.  So, for a host with the name, computer1, you would edit the file /mnt/HD_a2/ffp/etc/BackupPC/pc/computer1.pl and put in:
  $Conf{XferMethod} = 'rsyncd';   $Conf{XferMethod} = 'rsyncd';
  $Conf{RsyncShareName} = 'docs'; #this setting must match a later file   $Conf{RsyncShareName} = 'docs'; #this setting must match a later file
Line 251: Line 328:
Now you're ready to add more computers to be backed up to the server and edit your settings to your liking. Now you're ready to add more computers to be backed up to the server and edit your settings to your liking.
 +
 +
 +
===== Troubleshooting ===== ===== Troubleshooting =====
-"unknown host" error when starting a backup +== "unknown host" error when starting a backup == 
 +
This can happen if you have added a host to conf/hosts but forgotten to reload the config file. This can happen if you have added a host to conf/hosts but forgotten to reload the config file.
Line 263: Line 344:
And to make this work on startup add to the end of your fun_plug file: And to make this work on startup add to the end of your fun_plug file:
  echo "192.168.xxx.xxx computer1 computer1" >> /etc/hosts   echo "192.168.xxx.xxx computer1 computer1" >> /etc/hosts
 +
 +
 +Edited by PetoZ 4.1.2010.
 +
 +== backup aborted (inet connect: Connection timed out) ==
 +
 +Connection is blocked on firewall or rsyncd on client computer is not running.
 +
 +
 +== restore failed (Unable to read 4 bytes) ==
 +
 +To fix this change read only = false in c:/rsyncd/rsyncd.conf file on your client computer.
 +I tested it and it works on Windows XP Home and Professional.
 +
 +
 +
 +
 +
 +
 +
 +
 +

Navigation

Personal Tools