This repo contains config file(s) to run BackupPC on Nginx web server.
I was surprised that BackupPC doesn’t support Nginx out of the box and for a while I had to have Apache2 running on my machine next door to Nginx.
Here is my solution how to get rid of Apache2 in favor of Nginx. Note you will need fcgiwrap
with this to handle the FastCGI processing.
-
Comment out lines which starting with auth_basic in /etc/nginx/sites-available/backuppc. That disables authentication to simplify the first run.
-
Put
etc/nginx/sites-available/backuppc
ORetc/nginx/sites-available/backuppc-ssl
to/etc/nginx/sites-available/backuppc
. Chown it toroot.root
-
Replace every occurence of
yourdomain.tld
with your actual domain name. If you choose the SSL-vhost replace the bogus paths to certificate, key and dhparams to your actual ones. -
Create a soft link
/etc/nginx/sites-enabled/backuppc
to/etc/nginx/sites-available/backuppc
-
Restart nginx
sudo service nginx restart
I added backuppc configs to etc/backuppc/localhost.pl to backup my settings. You may found useful to start defining your excluded files pool on the base of my one:
$Conf{BackupFilesExclude} = { '*' => [ '/usr/lost+found', '/var/run', '/var/games', '/var/spool', '/var/cache', '/var/lock', '/var/tmp', '/var/lost+found', '/var/lib/backuppc', '/var/log', '/backup', '/data', '/dev', '/media', '/mount', '/proc', '/home/*/.mozilla/*/*/Cache', '/home/*/.mozilla/*/*/Cache.Trash', '/lost+found ', '/mnt', '/sys', '/tmp', "/home/*/\x{417}\x{430}\x{433}\x{440}\x{443}\x{437}\x{43a}\x{438}", "/home/*/\x{41c}\x{443}\x{437}\x{44b}\x{43a}\x{430}", '/home/*/tmp', '/home/*/.thumbnails', '/home/*/.rvm', '/home/*/.wine', '/home/*/.PlayOnLinux', '/home/*/.vmware' ] };
This program usually starts by cron daily. It indexes all files in your system. It does index all your backup files if you doesn’t instruct it not doing so with certain directories.
To stop mlocate.db messing up with your backups just put the backup partition to /etc/updatedb.conf
or mount it temporarily for the time backuppc does its job.
My backups are placed under /backup partition (I know it’s not the best solution in general, but certainly better than not backing up at all in case you have limited internet connection and doesn’t have place for separate HDD in your laptop). So, I added it to /etc/updatedb.conf PRUNEPATHS="/tmp /var/spool /media /data /backup"