How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS

Advertisement

rsnapshot Once Set, Can Automatically Incrementally Backup. rsnapshot is a Free Software intended to use on CLI for server backups. It is essentially a filesystem snapshot utility based on more older tool rsync. rsync takes snapshots of local and remote filesystems, and rotates the snapshots according to your settings. Here is How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS. We discussed about cheap cloud servers/VPS like VPSdime and Aruba cloud. Their cheaper cost make them excellent to use as backup servers. However, SSH needs to be secured with proper configaration of iptables and fail2ban. As they are accessible over public internet, the setup of second cheap server as backup server does have minimum matters of security. Our recommended way of keeping monthly backup is using some cloud storage which can be locked down as private. We can use free Dropbox for that purpose of backup or OpenStack Swift based object storage. However, that way is usually slower. In other words, we need multiple ways of backup and rsnapshot way not going to harm! You can also look at official Github repo of rsnapshot for documentations :

Vim

1

https://github.com/rsnapshot

How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS

Thankfully, rsnapshot is available on repositories of commonly used server OS, so we can easily install rsnapshot on the server that you would like to use as your backup server with these kind of command :

Vim

1

2

apt install rsnapshot

yum install rsnapshot

Now, cd to /etc and look if /etc/rsnapshot.conf.default file exists. In that case simply :

Vim

1

cp/etc/rsnapshot.conf.default/etc/rsnapshot.conf

If /etc/rsnapshot.conf.default file does not exist, then create a backup of /etc/rsnapshot.conf file :

Vim

1

cp/etc/rsnapshot.conf/etc/rsnapshot.conf.default

That is for future reference. You can always run configtest :

Advertisement

---

Vim

1

rsnapshot configtest

To backup another server, backup server will need to be able to connect through SSH. We need to generate SSH keys to authenticate, run this on backup server :

Vim

1

sudo ssh-keygen-trsa

We will not use a passphrase for this key because we want these servers to auto-connect. Press ENTER through all of the prompts to accept the defaults. We now have a public and private key pair. We need to transfer our public key to the machine we will be backing :

Vim

1

sudo ssh-copy-id-i/root/.ssh/id_rsa.pub root@IP-of-server-to-backup

Now, test from backup server :

Vim

1

sudo ssh root@IP-of-server-to-backup

You should not face password prompt. Return back to backup server.

Now, open that configuration file :

Vim

1

nano/etc/rsnapshot.conf

Arch Linux has good documentation :

Vim

1

https://wiki.archlinux.org/index.php/Rsnapshot

Decide where you would like to store backups. Peoples usually use directory like /backup as backup location. On settings, that will be the path :

Vim

1

snapshot_root/backup/

Uncomment the cmd_ssh line to allow for remote backup and cmd_du lines :

WordPress SaaS – WordPress as a Service on Cloud Computing Platform. How it is prepared and delivered ? What is advantages for the use and aspects ? We run a limited Pilot project to deliver WordPress SaaS and WordPress VIP delivers WordPress SaaS. We are taking the readers has the basic idea about SaaS, if […]