Skip to content

haptiq/haptiq-backups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haptiq Backups

A bash script for creating encrypted WordPress backups using restic and storing them on remote storage.

What it does

  • Exports WordPress databases using WP-CLI
  • Creates encrypted backups of site files and database dumps
  • Stores backups on remote storage using restic
  • Handles backup scheduling with cron-like syntax
  • Removes old backups based on retention policies
  • Cross-platform compatible (macOS/Linux)

Installation

Requirements

Environments may vary, a lot. Ideally you have SSH access to the system where the backup script should be periodically executed and the ability to install tools.

  • SSH access
  • Ability to install restic and wp-cli
  • Ability to execute commands/scripts
  • Ability to create cronjobs to automate backups

Step by step

  1. Install dependencies:

  2. Clone this repository:

    git clone https://github.com/haptiq/haptiq-backups.git
    cd haptiq-backups

The script should be executable after cloning the repository. If that's not the case, make the script executable:

chmod +x haptiq-backups.sh

Configuration

Create .env files in ~/.config/haptiq-backups/ for each site you want to backup. See example.com.env for a complete configuration example.

Usage

Run manually:

./haptiq-backups.sh

Or add to crontab for automatic execution:

# Check every 5 minutes
*/5 * * * * /path/to/haptiq-backups.sh

The script compares the last backup time with the scheduled time from each site's configuration and only runs backups when they're due. This allows you to run the script frequently without creating unnecessary backups.

License

Licensed under the GNU General Public License v3 (GPLv3). See LICENSE file.

Get In Touch

Haptiq Studio – Get In Touch

About

An automated backup solution for WordPress sites

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages