How To Install Poppins For Backup on CentOS 7
In this opportunity, we will talk about a free tool called Poppins that allows us to make a backup in Linux of the most valuable information in our organization and transfer these copies to remote locations.
What is Poppins?
Poppins is a command line tool developed in PHP that will give us the possibility of generating the backup of the sensitive information that we manage by providing a high level of security.
For this tutorial, we will use a computer with a CentOS 7 environment.
System Update
Before carrying out any installation of a tool or program, it is advisable to update the different packages that we have in the system.
For this case, CentOS 7, we will use the command:
sudo yum update
For Debian or Ubuntu we can use the command:
sudo apt-get update
Packages needed to run Poppins
To run Poppins, it is necessary to have the following packages in CentOS 7 or in the system to install the tool.
- Mercurial
- Php5-cli (php-cli)
- Rsync
- SSH
- Grep
- Gzip
The ssh, rsync, gzip and grep packages come pre-installed by default in Linux, which is why we should not be worried about the installation of these packages.
Install required packages
We will proceed to install the packages that do not come by default in Linux like Mercurial and php-cli.
To install these packages we will use the command:
sudo yum install mercurial php-cli
Edit php.ini file
Once we have downloaded and installed the necessary packages we can perform the Poppins installation, but first we must see the php.ini file which is in the path /etc/php.ini in order to configure the time zone for the correct copy of security.
We will edit this file with the preferred editor, in this case we will use nano.
sudo nano /etc/php.ini
We will see the following php.ini window where we must locate the date.timezone line and enter the necessary value according to our location, note that by default it is blank.
Save the changes using the key combination Ctrl + O and exit the editor using the combination Ctrl + X (In case we are using nano).
http://php.net/manual/en/timezones.php
Clone Poppins Repository
Once the time zone parameters are defined, we will clone the Poppins repository in CentOS 7 using the following command:
sudo hg clone https://bitbucket.org/poppins/poppins/opt/poppins
Now we must link this file in its correct location using the command:
ln -s /opt/poppins/init.php /usr/local/bin/poppins
Once we have completed the previous step we can verify the version of Poppins using the command:
poppins -v
Using Poppins: Script Backup
In the official website of Poppins we can find detailed information about how to use Poppins but the basic way is to create a script in the following way:
Create the directories:
mkdir poppins.d cd poppins.d mkdir logs conf backups
Copy of the configuration template:
cp /opt/poppins/solvetic.poppins.ini /root/poppins.d/conf/solvetic.poppins.ini
The basic script for this configuration is the following:
[local] rootdir = "/root/poppins.d/backups" logdir = "/root/poppins.d/logs" hostdir-name = 'solvetic' hostdir-create = yes snapshot-backend = 'default' [remote] ssh = yes retry-count = 0 retry-timeout = 5 host = 'solvetic' user = 'root' pre-backup-script = ""; pre-backup-onfail = "abort"; [included] / = 'root' [excluded] [snapshots] incremental = 2 1-daily = 7 1-weekly = 4 1-monthly = 2 1-yearly = 1 [meta] remote-disk-layout = yes remote-package-list = yes [log] local-disk-usage = yes compress = yes [rsync] compresslevel = 0 hardlinks = no verbose = yes retry-count = 0 retry-timeout = 5 [mysql] enabled = no configdirs = ''
Inside the script, we are configuring all the parameters of origin, destination, type of backup, among others.
These free tools undoubtedly help us in our backup tasks, and so we can keep all sensitive information either personal or organizational always available at any time.