GithubHelp home page GithubHelp logo

hushbackup's Introduction

hushbackup

This tool backups a certain folder as .tar archive and uploads it to another server via SFTP (SSH based) with Email notification.

demo

Download

Visit Releases to grab the binary for your machine. hushbackup is portable with only a binary file and nothing else.

Or compile yourself by checking build.cmd / build.sh.

Single Run

Execute

hushbackup-1.0-linux-amd64 config.json

Here is the guide for configuration file.

{
  "source": {
    "tarballFolder": "/home/me/important_code", // the folder you want to backup
    "tempFolder": "/mnt/hdd1/temp" // a temporary path to save .tar file of tarballFolder
  },
  "target": {
    "host": "10.1.2.3", // ip of the machine you want to upload to
    "port": "22", // SFTP port
    "username": "me", // the username to login target machine
    "password": "123456", // the corresponding password
    "saveFolder": "/mnt/hdd1/bak" // the directory to store the transferred .tar file
  },
  "notification": {
    "smtp": "smtp.qq.com", // SMTP server of sender
    "port": "465", // port of SMTP server
    "from": "[email protected]", // sender's address
    "to": "[email protected]", // receiver's address. keep empty to disable email notification
    "username": "[email protected]", // sender's username, usually same as `from`
    "password": "abcdef123456" // sender's password (or authentication code)
  }
}

โš ๏ธ The config file contains plaintext passwords, so remember to set a suitable permission.

chmod 700 config.json

Scheduled Task

We can use crontab to set up scheduled task to backup periodically.

crontab -e

# Run at everyday's 03:30.
30 3 * * * /path/to/hushbackup-1.0-linux-amd64 /path/to/config.json > /path/to/log.log

Roadmap

  • Support Public Key authentication
  • Support gzip to get .tar.gz

License

MIT

Means that I take no responsibility for any results brought by the software.

hushbackup's People

Contributors

z0gsh1u 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.