Revised: 2016-09-03, Al Reaud, Happy Cat Technologies
The following script integrates backing up the database with backing up the site code. Please note that descriptions place-hold for actual values in the script. Those actual values must be edited in, depending on your site configuration, for the script to work.
This script is adapted from the updated fullsitebackup.sh script created by Bristolguy on Drupal.org. This script is currently operational on Ubuntu 16.04, and has not been tested on other versions of Linux.
The shell script is available here for your convenience, demo.full_site_backup.sh.txt.