Install Poppins on Debian (stretch)

Let’s install Poppins on the backup server called “umbrella” and remote host called “drizzle”, both Debian machines. For this example to work, let’s assume the host “drizzle” is defined in /etc/hosts.

A lot of documentation is provided in the sample configuration file. Please read it carefully.

Setup Backup Server

Install required packages:

root@umbrella ~ # apt install mercurial php5-cli rsync ssh grep gzip

Set the appropriate timezone in /etc/php5/cli/php.ini if required. For a full listing of available timezones, see http://php.net/manual/en/timezones.php. For example, we’ll set the timezone to Brussels:

date.timezone = Europe/Brussels

Download the source code from bitbucket:

root@umbrella ~ # hg clone https://bitbucket.org/poppins/poppins /opt/poppins

Make a link to init.php in /usr/local/bin:

root@umbrella ~ # ln -s /opt/poppins/init.php /usr/local/bin/poppins

Verify the installation:

root@umbrella ~ # poppins -v

Setup Remote Host

root@drizzle ~ # apt install rsync ssh grep aptitude

Setup Connection

Establish a passwordless ssh login:

root@umbrella ~ # ssh-keygen
root@umbrella ~ # ssh-copy-id drizzle

Configure Poppins

Create directories. The location of these directories is up to you. For example you may want to backup to another mounted partition or external drive. For simplicity’s sake, we are creating 3 directories next to each other.

root@umbrella ~ # mkdir poppins.d
root@umbrella ~ # cd poppins.d
root@umbrella ~/poppins.d # mkdir logs conf backups

Copy the configuration template:

root@umbrella ~ # cp /opt/poppins/example.poppins.ini /root/poppins.d/conf/drizzle.poppins.ini

Edit the configuration file as desired. Please read the configuration file very carefully.

Example:

[local]
rootdir = "/root/poppins.d/backups" # location of all backup hosts
logdir = "/root/poppins.d/logs" # location of our log files
hostdir-name = '' # snapshots directory, defaults to remote host, e.g. "drizzle"
hostdir-create = yes # create the host directory if not exists
snapshot-backend = 'default' # default snapshot mechanism if not using zfs or btrfs
[remote]
ssh = yes # use ssh
retry-count = 0 # do not retry if connection cannot be established
retry-timeout = 5 # irrelevant if retry-count is set to zero 
host = 'drizzle' # resolvable hostname or IP address
user = 'root' # ssh user
pre-backup-script = ""; # no remote script before taking the backup
pre-backup-onfail = "abort"; # irrelevant, pre-backup-script is empty
post-backup-script = ""; # no remote script after backup 
[included]
/ = 'root' # include entire system tree
[excluded]
[snapshots]
incremental = 2 # keep 2 incremental snapshots
1-daily = 7 # keep 7 daily snapshots
1-weekly = 4 # keep 4 daily snapshots
1-monthly = 3 # keep 3 monthly snapshots
1-yearly = 1 # keep 1 yearly snapshot
[meta]
remote-disk-layout =  yes # show extra info about disk layout
remote-package-list =  yes # list all installed packages 
[log]
local-disk-usage =  yes # calculate disk usage of the backups
compress = yes # gzip log files 
[rsync]
compresslevel = 0 # see rsync documentation
hardlinks = no # see rsync documentation
verbose = yes # see rsync documentation
retry-count = 0 # retry rsync if failed
retry-timeout = 5 # irrelevant if retry-count is set to zero
cross-filesystem-boundaries = no # see rsync documentation
[mysql]
enabled = no # do not take a backup of mysql database
configdirs = '' # irrelevant, we do not need mysql backups 

Run the script

root@umbrella ~ # poppins -c /root/poppins.d/conf/drizzle.poppins.ini

Run as a cronjob

If you want to run Poppins in cron, make sure the path is set correctly, or use an absolute path. As an example, we run the backup job every night at 01:01 AM.

1 1 * * * /usr/local/bin/poppins -c /root/poppins.d/conf/drizzle.poppins.ini
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s