Backup Guide

Production Server Backups

Production server disaster recovery covered by SLA with Fully Managed VPS Server.

Development Server Backups

The script is utilized for scripted backups.

Assumed LAMP Server Directory Structure:


Note:  created when running the script (which installs and configures a LAMP server)

Development Server(s):

LAMP Server Configuration Files:

/etc/php/<php.version>/apache2/php.ini ----->/web/backups/etc-php-<php.version>-apache2/

Website Configuration Files:


MySQL backups:

/<mysqltables>/*.* --------------->/web/backups/mysql/

webroot Files:

/web/webroot/*-------------------> /web/backups/webroot/

Shell Scripts (.sh)

/web/scripts/*---------------------> /web/backups/scripts/

Ubuntu Backup Locations:


Backup File Location(s)

Backup File Structure:

Each node’s backup files will be stored in its own folder on the backup device:


update to include date? trim old?

Backup Devices (The Smurflings Ext HDD’s located on desk in office):

  • Sassette (6TB USB 3.0 – Ext4)
  • Snappy (6TB USB 3.0 – NTFS)
  • Slouchy (1.5TB USB 3.0 – NTFS)

Files that do NOT require backing up:

  • caches & temporary files
  • installation files
  • core files that can be re-distributed (ie: node_modules)
  • log files

CRON Schedule

CRON Jobs are located and served from:


Scripts in that folder should not be edited directly.

They should be edited elsewhere and when ready, copied over top of the current CRONJOB

To edit file:

crontab -e

Added the following:

# m h  dom mon dow   command
08 16 * * * sudo /bin/sh /web/scripts/ 2>&1 /tmp/mycron.log

Reload cron for above changes to take effect:

# reload cron:
sudo service cron reload


  • Risk assessment for complete data loss from VPS
    • what would happen my server got turned off?
    • unrecoverable data loss?
  • Versioning / how to archive/deal with old backup files?
  • Compression:
    • effect of compression on various files types (image vs text)
    • How much disk space saved? Is it worth the effort?
    • Only archives? (but also store un/compressed files)
  • Should MySQL be shut down before backing up?
    • What about Production databases?
    • Permissions preserved with recovery?
  • Write Recovery shell script and test full recovery process
  • Checking if things exist first, like directories, and if not, creating them