Skip to content

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

Notifications You must be signed in to change notification settings

renshuki/friendly-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages