Automate Your WordPress Backup With Simple Bash Script

This simple script is great for backing up a WordPress site. It can really be modified easily to work with any site though!

What does this backup script do?

  1. Makes a copy of your whole site directory.
  2. Compresses the copied directory for storage.
  3. Saves the compressed backup to a folder.
  4. Makes a backup of your MySQL Database.
  5. Compresses your Database backup file and saves it to a folder as well.

I would recommend setting up a Cron Job on your server to run this backup script at regular intervals, perhaps everyday or every week.

The Bash Script