Git Product home page Git Product logo

encrypted-email-backup's Introduction

encrypted-email-backup

A simple script to backup your server to a email address as an encrypted compressed backup. The script itself is independent of your software being backed up, just pipe it the the backup (for multiple files, use tar).

Developed to support an article sponsored by the VpsBoard article bounty program.

Features

  • Assymetric and Symetric encryption modes
  • Backup compression
  • Simple
  • Reports backup failures via email

Requirements

  • mutt: To send emails
  • openssl: For encryption, compiled with zlib support
  • bash: language of the script

Limitations

Mail is sent with the backup as an attachment, you may be limited by the attachment size of your mail provider if you are not using your own mail server. See the wishlist if you want to develop an alternative upload method.

Usage

How to Use

Using this software is simple, its just a matter of piping your backup to the script, and supplying the required parameters.

Usage

Encrypted Backup Script

Usage:
./backup.sh backup [KEY] [FILENAME] [EMAIL] [SUBJECT]
Description: Take the backup supplied via stdin, compress, encrypt and email to [email protected]
Example: take_backup | ./backup.sh backup ~/backup.key backup.sql [email protected] "Database Backup"

cat file.sql.gz.enc | ./backup.sh decrypt [KEY] > file.sql
Description: Decrypt the file file.sql.gz.enc to file.sql

Instructions & Examples

See the post at: https://vpsboard.com/page/index.html/_/linux-vps-tutorials/how-to-create-secure-linux-server-backups

Planned Features / Wishlist

  • FTP Upload & HTTP Download
  • Dropbox or Cloud service upload / download

Feel free to submit a pull request.

License

The MIT License (MIT). See LICENSE.

encrypted-email-backup's People

Contributors

splitice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

deliverability

encrypted-email-backup's Issues

Using OpenSSL's 'built in' zip functionality

Nice shell script!
Minor tip: I don't know if you're aware of this, but you could use the built-in compression utility of OpenSSL (if it's compiled with the zlib option). Currently there are several pipes being used

cat - | gzip | openssl enc -aes-256-cbc -kfile "$BACKUP_KEY" > "$BACKUP_FILE"

You could replace this by using

cat - | openssl enc -aes-256-cbc -kfile "$BACKUP_KEY" -z > "$BACKUP_FILE"

This probably is a bit more efficient, both processor- and space-wise.
Likewise you can use the -z flag for decompression as well:

Replace

cat - | openssl enc -aes-256-cbc -d -kfile "$BACKUP_KEY" | gzip -d

by

cat - | openssl enc -aes-256-cbc -d -kfile "$BACKUP_KEY" -z

Cheers,

Peter

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.