• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS

By Abhishek Ghosh May 11, 2018 9:37 am Updated on May 11, 2018

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 :

Advertisement

---

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 :

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 -t rsa

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 :

Vim
1
2
cmd_ssh /usr/bin/ssh
cmd_du /usr/bin/du

That cmd_du enables accurate disk usage reports. Uncomment the ssh_args section :

Vim
1
ssh_args -p 25000

What directories to backup is written in this style :

Vim
1
backup      root@IP-of-server-to-backup:/etc/     example.com/

Backup interval part will be like this :

Vim
1
2
3
4
retain hourly  6
retain daily   7
retain weekly  4
retain monthly 3

You can test :

Vim
1
2
sudo rsnapshot configtest
sudo rsnapshot -t hourly

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

rsnapshot has all scripts, including cron :

Vim
1
sudo nano /etc/cron.d/rsnapshot

That will look after editing like this :

Vim
1
2
3
4
0 */4         * * *           root    /usr/bin/rsnapshot hourly
30 3          * * *           root    /usr/bin/rsnapshot daily
0  3          * * 1           root    /usr/bin/rsnapshot weekly
30 2          1 * *           root    /usr/bin/rsnapshot monthly

You can check disk space :

Vim
1
rsnapshot du

So, you understood that WordPress PHP files, images will be pulled to backup server. But what about MySQL? rsnapshot has lot of scripts, and for MySQL, below is brief list of works to setup :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
apt-get install mysql-client
cp /usr/share/doc/rsnapshot/examples/utils/backup_mysql.sh /usr/local/bin/
chown root.root /usr/local/bin/backup_mysql.sh
chmod o-w /usr/local/bin/backup_mysql.sh
nano /usr/local/bin/backup_mysql.sh
# replace
## /usr/bin/mysqldump --all-databases > mysqldump_all_databases.sql
# with
## /usr/bin/mysqldump --defaults-file=/etc/mysql/debian.cnf --all-databases > mysqldump_all_databases.sql
# use below command to dump a single database :
## /usr/bin/mysqldump --defaults-file=/etc/mysql/debian.cnf DATABASE > DATABASE.SQL
nano /etc/rsnapshot.conf
# Under BACKUP POINTS / SCRIPTS add
## backup_script /usr/local/bin/backup_mysql.sh localhost/mysqldump/
# test
rsnapshot configtest

rsnapshot is great tool. There are lot of scripts with huge documentation :

Vim
1
https://github.com/rsnapshot/rsnapshot/tree/master/utils

This Article Has Been Shared 336 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

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

  • Best Tools For Web Server Log Processing & Statistics Running WordPress

    Commonly We Run One Server One WordPress Website Setup. Here Are Some Best Tools For Web Server Log Processing & Statistics Running WordPress Which Are Self-Hosted.

  • Cloud Hosting Versus Dedicated Hosting For WordPress

    Cloud Hosting Versus Dedicated Hosting For WordPress is a hot topic right now as some Cloud Hosting costs more than Dedicated Hosting.

  • WordPress SaaS : Perspective of User and Vendor Aspects

    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 […]

  • Juju Package Manager for Cloud Computing

    Juju is a Package Manager, service orchestration management tool developed by Canonical for development of Cloud Computing of your own. It is Open Source.

  • Red Hat OpenShift PaaS : Smart Guide to Host Your App

    Red Hat OpenShift PaaS has pre-configured one click installers for Frameworks, one click installers for WordPress, Drupal. Free for 50k visitors per month.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How to Make the Most of Your S Pen (S22 Ultra) June 29, 2022
  • Safe Chargers for Samsung Galaxy S22 Ultra June 27, 2022
  • How Telecoms Can Use The Cloud To Power Their 5G Network June 24, 2022
  • A Beginner Guide to Cloud Computing for Development June 22, 2022
  • 5 Benefits of Using a Virtual Data Room Today June 19, 2022

About This Article

Cite this article as: Abhishek Ghosh, "How To Set Up rsnapshot For Backup Of WordPress on Cloud Server/VPS," in The Customize Windows, May 11, 2018, June 30, 2022, https://thecustomizewindows.com/2018/05/how-to-set-up-rsnapshot-for-backup-of-wordpress-on-cloud-server-vps/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy