Git Product home page Git Product logo

backup-scripts's Introduction

Backup Scripts

Various backup scripts for backing up your Shared Hosting account on Kaizen Gardens Shared Hosting service. Can also be used for backing up data on Joyent SmartMachines and TextDrive's legacy Shared Hosting service.

Getting Started

Currenty expects to be run under SmartOS zones (useful if you're on a Kaizen Gardens Shared Hosting account on SmartOS or a Joyent SmartMachine).

SSH Keys

Best to use seperate private/public key-pairs to authenticate to different services.

In ~/.ssh/config use something like:

Host example.strongspace.com
  IdentityFile ~/.ssh/id_rsa-strongspace

MySQL

Expects a ~/.my.cnf file to be configured:

[client]
user = username
password = password
MYSQL_DAYS_TO_KEEP=14
Key Type Description Example
MYSQL_DAYS_TO_KEEP string Number of days worth of backups to store (it removes files older than X days based on the file modification time) 14

PostgreSQL

Expects a ~/.pgpass file to be configured.

PGSQL_DAYS_TO_KEEP=14
Key Type Description Example
PGSQL_DAYS_TO_KEEP string Number of days worth of backups to store (it removes files older than X days based on the file modification time) 14

Offsite Backups

Presently supports backing up to a remote SFTP location.

#
# Backup Host
#
BACKUP_OFFSITE_ENABLED=yes
BACKUP_HOST=sftp.example.com
BACKUP_USER=username
BACKUP_REMOTE_DIR=/path/to/backups/

RSYNC_OPTS=--delete-after
Key Type Description Example
BACKUP_OFFSITE_ENABLED string Is offsite backup syncing enabled yes
BACKUP_HOST string Hostname or IP Address of the server where files are backed up to sftp.siberia.co.za
BACKUP_USER string Username on the server specified in BACKUP_HOST jacques
BACKUP_REMOTE_DIR string The remote diretory where files are uploaded to /users/home/jacques/remote-backups/joey/
RSYNC_OPTS string Specifies options to rsync. To do a "dry run" use --dry-run. --delete-after

Generate a SSH public/private key-pair

Generate a public/private key-pair without a passphrase so that backups can be uploaded offsite without prompting to enter a password or a pass phrase to unlock the ssh private key.

ssh-keygen -t rsa -b 4096 -N ''

You may want to store this to generated key-pair to ~/.ssh/id_rsa-strongspace for a public/private key-pair you just use with StrongSpace.

Configuration files

Copy config.example to config so that the configuration can be sourced by the various scripts.

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b fix-for-something)
  3. Commit your changes (git commit -am "[#TICKET] Fixed something")
  4. Push to the branch (git push origin fix-for-something)
  5. Open a Pull Request
  6. Enjoy a refreshing Dr Pepper and wait for the pull request to be merged

License

Copyright (c) 2013-2014 Jacques Marneweck. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

backup-scripts's People

Contributors

jacques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backup-scripts's Issues

Dump MySQL databases belonging to a user

Implement a backup script to dump each database belonging to a user to a seperate files.

Add option to backup offsite (to another TextDrive Shared Hosting account, or StrongSpace or other SFTP location).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.