Hello All,
This guide will walk you through setting up BackupPC on OMV Kralizec and Sardaukar. This guide is provided as-is.
There is no plan to make it a plugin for OMV. The steps provided will setup BackupPC as a virtual host. We will move
the backup location so it does not use /var/lib/backuppc.
1. Install the BackupPC package. For Krazelic we will add the apapche2-utils for the htpasswd tool and we add the fcgiwrapper to add cgi support for nginx.
During the install of BackupPC, DO NOT select to auto configure apache2.
For Sardaukar:
For Krazelic:
2. Create a user in the htpasswd file for authentication. In this example we will use backuppc. Enter your desired password when prompted.
3. Create the web configuration file. We will be running BackupPC as a virtual host using port 81.
For Sardaukar:
<VirtualHost *:81>
ServerName backuppc
UseCanonicalName Off
DirectoryIndex index.cgi
ServerSignature Off
DocumentRoot /usr/share/backuppc
ErrorLog ${APACHE_LOG_DIR}/backuppc_error.log
CustomLog ${APACHE_LOG_DIR}/backuppc_access.log combined
<Directory "/usr/share/backuppc/cgi-bin/">
Options +ExecCGI -Indexes +FollowSymLinks -SymLinksIfOwnerMatch -Includes +MultiViews
Addhandler cgi-script .cgi .pl
AllowOverride AuthConfig Indexes Limit Options
</Directory>
Alias /backuppc "/usr/share/backuppc/cgi-bin/"
</VirtualHost>
Display More
Using your desired editor, save this file to /etc/apache2/sites-available/backuppc
Enable the site
Open a browser and goto http://<your omv host name or ip>:81/backuppc and you should be promted to login. Use backuppc and the password you set. If all went well
then the BackupPC page should appear.
For Kralizec:
server {
listen 81;
server_name omv-backuppc;
access_log /var/log/nginx/backuppc.access_log;
error_log /var/log/nginx/backuppc.error_log;
root /usr/share/backuppc/cgi-bin;
location /backuppc {
auth_basic "BackupPC admin";
auth_basic_user_file /etc/backuppc/htpasswd;
alias /usr/share/backuppc/cgi-bin/;
index /index.cgi;
}
location ~\.cgi$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index BackupPC_Admin;
fastcgi_param SCRIPT_FILENAME /usr/share/backuppc/cgi-bin$fastcgi_script_name;
}
}
Display More
Using your desired editor, save this file to /etc/nginx/sites-available/backuppc
Enable the site
sudo ln -s /etc/nginx/sites-available/backuppc /etc/nginx/sites-enables/backuppc && sudo service nginx reload
Open a browser and goto http://<your omv host name or ip>:81/backuppc and you should be promted to login. Use backuppc and the password you set. If all went well
then the BackupPC page should appear.
4. Move the backup location to the storage mounted with OMV. I decided not to use the web interface to make the destination folder. You may do so if you desire. I have not tested it using the
web interface though. I merely did it this way for simplicity. I'll have to test it out later using the web interface. Let's make the new folder for your backups to reside in.
Replace <someridiculouslylongfoldernamewhereyouwantbacckuppctobe> with the correct name on your system.
cd /media/<someridiculouslylongfoldernamewhereyouwantbacckuppctobe>
sudo mkdir backuppc && sudo chown backuppc:backuppc backuppc
Stop BackupPC
Login as the backuppc user to copy the cpool and hardlinks
sudo su - backuppc
cd backuppc
mkdir pc
cp -a /var/lib/backuppc/* .
cd pc
./usr/share/backuppc/bin/BackupPC_tarPCCopy /var/lib/backuppc/pc | tar xvPf -
exit
Now let's rename the old directory to keep it as a backup and symlink to the new location. Replace <someridiculouslylongfoldernamewhereyouwantbacckuppctobe> with the correct name on your system.
sudo mv -f /var/lib/backuppc /var/lib/backuppc.save
sudo ln -s /media/<someridiculouslylongfoldernamewhereyouwantbacckuppctobe>/backuppc /var/lib/backupppc
Start BackupPC
If all went well BackupPC should start normally. If you get a "failed to start" then check the permissions on the backuppc folder. It should match the permissions of the /var/lib/backuppc.save folder.
A quick and dirty way to fix this is to sudo chmod -R 775 the backuppc folder.
5. Time to configure!
Open a browser and goto http://<your omv host name or ip>:81/backuppc and you should be promted to login. Use backuppc and the password you set. If all went well
then the BackupPC page should appear. You are now ready to use BackupPC.
I would suggest removing the localhost configuration in BackupPC since it would be useless if the system crashes. Check the OMV forums on how to backup OMV configuration for Sardaukar. Kralizec has a plugin to
backup the configuration from the OMV-Extras repository. I would suggest using this instead. More information about removing localhost can be found here: http://backuppc.sourceforge.ne…Other-installation-topics
6. Sources
http://backuppc.sourceforge.net/faq/BackupPC.html
https://github.com/Zloy/backup…/sites-available/backuppc
https://wiki.debian.org/nginx/FastCGI
7. Notes
Here are some thoughts and opinions about this guide. I prefer use the rsync plugin in OMV. It is easy to use and to setup jobs.
BackupPC is a little more complex and is for more advanced users in my opinion. If you have Windows clients you can use the built-in backup agent or other 3rd party tools
to save the backups to a SMB/CIFS share. You can also use rsync on Windows. See this article from rsync.net: http://www.rsync.net/resources/howto/windows_rsync.html
So before using this guide, consider what you want to accomplish by using BackupPC. I am by no means putting down BackupPC. I have used it in the past and still do in certain environments.
This is just my opinion and your welcome to share your thoughts on BackupPC.