How to Schedule a Backup of All Websites Hosted on Ubuntu

Submitted by andy on Sun, 12/11/2016 - 04:04

In this guide, you will learn how to create a shell script that will backup all of your websites hosted on Ubuntu 16.04. You will also learn how to setup a scheduled task to run the backup script daily.


You may want to make regular backups of your websites just incase you get a virus or someone makes an irreversible change. In this guide, you will learn how to make a simple script that can be scheduled to archive multiple days worth of website backups. The guide assumes you have a directory structure like the following: