Git Product home page Git Product logo

backup-script's Introduction

backup-script

DESCRIPTION

  • This script is pretty simple. But it is ideal for periodic backing up your small-scale sites.
  • This script needs to be installed gdrive in order to work. Detailed information can be found at https://github.com/prasmussen/gdrive
  • This script can be used to upload your site files and database you have hosted on the VPS to Google Drive.
  • This script does not keep your backups on your server. Also, your Google Drive account may only have 1 backup.
  • You can run this script manually or automatically using cron.
  • If you use Cron, you can decide when backups will be taken. Just remember that your Google Drive account has 1 backup.

USAGE

  • First edit the "CHANGE BY YOURSELF" section according to your own information.
  • Upload the script to your server.
  • Do not forget to make the script executable. chmod a+x backup.sh
  • Add a cron job if you want to make a periodic backup.
  • A sample cron job (for backing up on Monday at 1:00 am UTC) :
    • Open the crontab editor with the crontab -e command.
    • Add the bottom line: \* 1 * * 6 /backup.sh >/dev/null 2>&1
  • If tar, mysqldump, zip and gdrive commands are in different locations, please update export PATH line.

Explanation of Variables

  1. NAME : A prefix for site backup files.
  2. FROM_BACKUP_DIR : The path to the root directory of the site files you want to back up (i.e public_html). DO NOT USE THE "/" AT THE END OF LINE.
  3. TO_BACKUP_DIR : The location where the compressed site files will be stored on the server. DO NOT USE THE "/" AT THE END OF LINE.
  4. GOOGLE_DRIVE_DIR : Your Google Drive folder ID. This folder must be empty when uploading first.
  5. DBUSER : MySQL database username.
  6. DBPASS : MySQL database password.
  7. DBNAME : MySQL database name.

The command is simple but the description is complicated :)

backup-script's People

Contributors

gorkemguray avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.