Multi-server incremental backup script with no remote footprint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Luna f34dcc0319 first commit 1 month ago
backups first commit 1 month ago
scripts first commit 1 month ago
.gitignore first commit 1 month ago
README.md first commit 1 month ago
backup-all.sh first commit 1 month ago

README.md

Luna’s No-Footprint Incremental Backups

Multi-server incremental backup script with no remote footprint.


Features

  • optional remote script execution before each backup
  • backup via rsync (very fast)
  • local incremental history via duplicity (go back in time in case of a hack)
  • no remote configuration (other than a working ssh connection)
  • no remote footprint whatsoever
  • very simple configuration
  • avoid backing up files via .backupignore files (following the .gitignore syntaxis)
  • one script to backup all your servers


Installation

Requires git. Note: the backup-all.sh script will automatically install rsync and duplicity when needed.

cd WHERE_YOU_WANT_TO_DOWNLOAD_IT
git clone https://code.can-i.help/luna/luna-nofootprint-incremental-backups backups
cd backups


Per-server configuration

If you don’t have an SSH connection already configured for your server in your ~/.ssh/config, add the following block to it:

Host YOUR_SERVER_ID
  Hostname THE_IP_OF_YOUR_SERVER
  User root
  Port 22
  IdentityFile /home/YOUR_UNIX_USER/.ssh/YOUR_SERVER_IDENTITY_FILE

Save and test entering ssh YOUR_SERVER_ID. If you login without entering credentials, you’re done for this step.

Then, to configure the server backup, do the following:

mkdir backups/YOUR_SERVER_ID
cp backups/.env.template backups/YOUR_SERVER_ID/.env
$EDITOR backups/YOUR_SERVER_ID/.env
# replace at least the value of SSH_HOST and save.

You can optionally drop backup-prepare.sh script files inside any folder of $REMOTE_FOLDER, for them to be executed before any backup. You can also use .backupignore files (using the .gitignore syntaxis) to avoid backing up some files and folders.


Run backups

./backup-all.sh

Files will be downloaded to backups/EACH_SERVER_ID/last and incremental may be generated at backups/EACH_SERVER_ID/incremental.

To automate it, run crontab -e and add the same command (with an absolute path) following the cron syntaxis, and save. You’re done.


License (MIT)

Copyright 2019 luna@can-i.help

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.


Contact & Issues

Please fill any issue through the project’s official issue tracker. For any other information, feel free to contact Luna at luna@can-i.help.