Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 1.78 KB

README.md

File metadata and controls

86 lines (61 loc) · 1.78 KB

friendly-backup

Simple shell script to backup your websites, databases and maybe more...

Installation

Just git clone the repo on your server.

Configuration

Setup variables between BEGIN Configuration and END Configuration.

Backups retention

# Number of days to retain backups (default: 10 days)
date=$(date +%Y%m%d)
deldate=`date --date '10 days ago' "+%Y%m%d"`

Change 10 days ago by whatever you want

Directories setup

Source directory where your websites are:

# Source directory
sourcedir="/my/source/directory"

Destination directory where your backups will be saved:

# Destination direcrtory (backups directory)
destdir="/my/destination/directory"

List up the websites directories you want to backup:

# Websites (separated by spaces)
sites='website1 website2 website3'

Databases setup

!!! CAUTION: Only MySQL is supported for the moment !!!

Your MySQL host (default: localhost):

# Database host
db_host='localhost'

Your MySQL user:

# Database user
db_user='my_db_user'

Your MySQL password:

# Database password
db_password='my_db_password'

Usage

  1. chmod u+x friendly-backup.sh
  2. ./friendly-backup.sh

Optional: Add a Cron Job

Todos

  • Add a way to backup config files too
  • Alternative backup for other DBMS
  • Make an interactive setup?

Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay