• 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 372 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 (24.3K 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

  • The Importance of Voice and Style in Essay Writing April 1, 2023
  • What Online Casinos Have No Deposit Bonus in Australia March 30, 2023
  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023

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, April 1, 2023, https://thecustomizewindows.com/2018/05/how-to-set-up-rsnapshot-for-backup-of-wordpress-on-cloud-server-vps/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT