Giter Club home page Giter Club logo

raptor's Introduction

raptor

Features

  • One touch, three minute install
  • Fully installs EasyEngine with all extra modules from the start and more
  • Set-it-and-forget-it backups will automatically run a backup of all your sites every night and email you in case of failure
  • Works with all EasyEngine site types
  • Stores backups both locally and remotely [on S3]
  • Encrypts all remote backups with a 42 character passphrase
  • Backs up new sites automatically with no need to perform any additional action
  • Requires no operations inside the individual websites, everything happens on the filesystem level completely unbeknownst to the websites themselves
  • Does NOT rely on EasyEngine's database but rather directly scans your /var/www/ directory
  • Performs a test restore before every S3 backup to ensure remote backup integrity and passphrase match
  • Allows you to restore your backup with one single command and a maximum of three minutes of your time even from a blank machine you've never set up before
  • Perfectly restores every aspect of every single EasyEngine website you're hosting, from your database, to all of your files [even outside htdocs], and so on
  • Performs DNS checks and prompts you to activate LetsEncrypt on newly restored sites
  • Actually [re-]installs and updates EasyEngine on install and restore operations to remove any extra step: you'll be fully operational with just one command
  • Returns detailed errors in case of failure to help you get your data back during a restore
  • Outputs clean and colorful logs and stores them automatically inside its own log directory

Install [or update / re-install] [tested on Debian 8 and Ubuntu 16]

[log in as root on your EasyEngine linux server]
cd
apt update
apt -y install git
git clone https://github.com/openspace42/raptor
bash raptor/setup

Backing up

Run backup script manually

raptor-backup

Confirm automatic daily run via cron is working

cat logs/raptor-backup/latest-log

Restoring

Preparation [only if this is a new machine]

  1. Run the installer as detailed above in the "Install" section

Actually restoring

raptor-restore

Advanced usage

See the Advanced Restore wiki page for runtime arguments.

raptor's People

Contributors

nordurljosahvida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raptor's Issues

Backup Compression

I'm not sure if this is possible, but I wonder whether there should be an option to not compress the backups?
For some people, I suspect this is not an issue, but my backup is going to take 6 hours to compress and is beating up the CPU pretty badly. I suspect the compression ratio won't be huge either as the majority of the files are already compressed anyway. Obviously, the database backups will be compressed massively, but they only make up a tiny proportion of my overall backup.
Thoughts?

Cloudflare intergration

Since many people use Cloudflare as their dns service, it would be nice to have this integrated into Raptor. With using the Cloudflare DNS no manual changes have to be done when restoring, because dns changes can be done with the Cloudflare api. Could you please take a look at this? I would like to help, but have no experience with BASH scripting.

Backup script doesn't exit on failure

I had to manually kill the backup script after it said it was exiting after failing due to a shortage of space.

:~# bash openspace42/raptor/tools/raptor-backup

Starting raptor-backup script on 2018-04-11_12-55-56...

You have 1 local backups occupying 53017 MB of space.

Estimated backup size [148188 MB] LARGER than available disk space [138618 MB].

Now purging old backups while respecting your specified number of minimum backups to keep...

root@shost7:~# The specified number of minimum backups to keep [1] is too high to free enough disk space for the next backup.

Lower this figure by re-running the install and lowering this figure during configuration or make more space available on this machine.

Exiting...

^C

Cronjob not created

Whilst the install script stated that it had created the cronjob, crontab -l only lists the default ee letsencrypt cron job

Tiny typo

"Enoguh" should be "Enough"

"Estimated backup size [148308 MB] LARGER than available disk space [142705 MB].

Now purging old backups while respecting your specified number of minimum backups to keep...

Enoguh free space [191634 MB] now available for new backup."

Cannot connect to digitalocean object storage

Hello,

I tried adding my digitalocean space (a s3 compatible object-storage service) to the raptor backup tool, but I got the following error: S3 connection details do NOT appear to be valid. Could you please help fix this? If necessary, I can provide you the keys for testing.

Install fails after trying to update EE

I get a message:
Now [re-]installing and updating EasyEngine...

Executing apt-get update, please wait...
[ Tue Apr 3 12:49:23 UTC 2018 ] You already have EasyEngine 3.7.5, exit status = 1
Downloading update script Unable to download file, /tmp/eeupdate20180403-124924

And then the installer stops.

restore_type: unbound variable

When I try to restore from a local backup I get to following error:

/root/openspace42/bash-functions/functions/backup_restore: line 905: restore_type: unbound variable

composer: command not found

Perhaps a check early in the script to test whether composer is installed, rather than crashing the script after installing the EE stack? Or install composer as part of the install?

Pwgen missing causes strange behaviours

Inititally the script will crash during S3 config due to missing Pwgen. Installing pwgen and restarting the script results in encryption phrase being blank. I assume that although pwgen is missing the script has already created the config file for the passphrase and then leaves it blank.

Add ability to reconfigure without running full setup

It would be useful to be able to reconfigure without having to run the whole setup routine again. I know you can edit the files directly, but that is not user friendly and skips any validation. When you rerun setup most of the time is wasted simply watching it redownload etc.

Installation error on ubuntu 16.04

After following the commands like stated in the readme, i get the following error when i want to execute the command: bash raptor/setup

Initiating setup...
/root/raptor/functions: line 181: /root/openspace42/dna/functions/*: No such file or directory

please guide me on this error.

After full reinstall backup doesn't run at all

I wiped the installation by removing the openspace directory and then reinstalled using the -be flags.

I did also change the local backup location with the new install. Now backups won't run at all. The process starts, but then it seems to jump directly to testing the restore. I'm not sure if maybe I missed something whilst removing the previous install that is now interfering.

bash openspace42/raptor/tools/raptor-backup               

Starting raptor-backup script on 2018-04-15_10-13-26...

You have 0 local backups occupying 1 MB of space.

Now testing restore from S3 to /var/backups/raptor-backups/restores/s3/ to ensure existing backups integrity and passphrase match...

This is going to take some time. Please let the process run, it won't print any output until its done.

Testing restore from S3 failed.

This is likely due to an incorrect passphrase [check | /var/backups/raptor-backups/temp/duplicity-log | for messages like: | gpg: decryption failed: bad key |].

If this is the case, you've likely changed your backups encryption passphrase on this machine between your last backup and this one.

Aborting backup as proceeding would cause your S3 backups to be encrypted with two or more encryption keys at the same time.

This would render them unusable in the future should you ever need them.

Edit the file | /root/openspace42/raptor/conf/backups/s3/backups_passphrase | and set once again your previous encryption passphrase, then re-run this script.

If you have lost your previous encryption passphrase, delete all your S3 backups and re-run this script to make an entirely new backup set encrypted solely with the currently specified passphrase.

Exiting...

Unable to download file, /tmp/eeupdate20180407-125625

When I try to install raptor using the install instructions my installation terminates and gives the following error:

Now [re-]installing and updating EasyEngine...
Executing apt-get update, please wait...
[ Sat Apr 7 12:56:25 CEST 2018 ] You already have EasyEngine 3.7.5, exit status = 1
Downloading update script Unable to download file, /tmp/eeupdate20180407-125625

Could you please help me fix this?

Cannot install

root@cloud:~# bash raptor/setup
Initiating setup...

/root/raptor/functions: line 184: /root/openspace42/dna/functions/*: No such file or directory

Using Ubuntu 18.04

Unable to set local backup storage location

I can't see how I would set a different local storage location.
Several of the sites to backup are very large, meaning the backup size is much larger than the available disk space.

Ideally, I wouldn't store any backups locally, but I assume the script requires local storage to create the backups before pushing off to S3.

I would, therefore, like to set an alternative local storage location so that I can complete backups. Whilst I imagine I could do it by hacking the script, I think it would make sense to be able to set this during setup?

Installing breaks ssh config

Once the installer had configured the cron job is going on to modify the ssh config. The installer crashed after trying to restart ssh:

Apr 04 09:50:19 shost7 systemd[1]: Starting OpenBSD Secure Shell server...
Apr 04 09:50:19 shost7 sshd[22013]: /etc/ssh/sshd_config line 88: garbage at end of line; "Match".
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Apr 04 09:50:19 shost7 systemd[1]: Failed to start OpenBSD Secure Shell server.
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Unit entered failed state.
Apr 04 09:50:19 shost7 systemd[1]: ssh.service: Failed with result 'exit-code'.

Adding a line break on line 88 fixed the problem.

Original:
UsePAM yes Match Group sftp_access
ChrootDirectory /home/%u
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

After adding line break:
UsePAM yes
Match Group sftp_access
ChrootDirectory /home/%u
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Testing restore from S3 failed

After it finally finished compressing my backup, the next section failed.
I wonder if it may be to do with the double slashes? Also, "/var/backups//temp/duplicity-log" didn't exist, with or without the double slash.
I did not change my encryption password.

"
Finished compressing backup and stored in | /var/backups//archive/ |

Finished local backup.

Now testing restore from S3 to /var/backups//restores/s3/ to ensure existing backups integrity and passphrase match...

This is going to take some time. Please let the process run, it won't print any output until its done.

Testing restore from S3 failed.

This is likely due to an incorrect passphrase [check | /var/backups//temp/duplicity-log | for messages like: | gpg: decryption failed: bad key |].

If this is the case, you've likely changed your backups encryption passphrase on this machine between your last backup and this one.
"

install_dependencies: line 35: packages: unbound variable

First attempt to install the software, I get the error "/root/openspace42/bash-functions/functions/install_dependencies: line 35: packages: unbound variable"

This happened the first time I tried to install (following the issue with EasyEngine failing to update being resolved), but I had answered No to the question to install the full stack of EE. I assumed that the error was due to something being required from the EE stack, so I retried and answered Y to install the stack and everything was fine. Therefore I assumed I must answer Y to avoid the error in future.
However, on this fresh install, I answered Y to install the stack and still got this error. SImply restarting the installation seems to fix the problem and the install continues.

Slightly larger dump of the script output.
Now installing dependencies...

Hit:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial InRelease
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:3 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
Ign:7 http://apt.newrelic.com/debian newrelic InRelease
Hit:8 http://apt.newrelic.com/debian newrelic Release
Ign:9 http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_16.04 InRelease
Hit:10 http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_16.04 Release
Hit:4 http://lon1.mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:5 http://lon1.mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:6 http://lon1.mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Hit:11 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial InRelease
Hit:12 https://repos.sonar.digitalocean.com/apt main InRelease
Hit:14 https://packages.amplify.nginx.com/ubuntu xenial InRelease
Reading package lists... Done
/root/openspace42/bash-functions/functions/install_dependencies: line 35: packages: unbound variable

bindfs depends on fuse

I have this error on Debian 8, when all is almost finished.

Setting up fuse (2.9.3-15+deb8u2) ...
Creating fuse device...
/run/udev or .udevdb or .udev presence implies active udev. Aborting MAKEDEV invocation.
chmod: cannot access '/dev/fuse': No such file or directory
dpkg: error processing package fuse (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of bindfs:
bindfs depends on fuse; however:
Package fuse is not configured yet.

dpkg: error processing package bindfs (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Errors were encountered while processing:
fuse
bindfs
E: Sub-process /usr/bin/dpkg returned an error code (1)

An error occured performing APT operations.

Exiting...

Trying to update raptor

By running command bash raptor/setup get this:
/root/raptor/functions: line 33: dna-define_vars: command not fount

getting error mail

Cronic detected failure or error output for the command:
bash /root/openspace42/raptor/tools/raptor-backup

RESULT CODE: 0

ERROR OUTPUT:
/root/openspace42/dna/functions/backup_restore: line 115: [: Avail: integer expression expected

Subdomains problem

If I have a subdomain listed on exclusion list than script is skipping main domain too. And saying that this site is on exclusion list

Space required calculation

I'm not sure how accurate the estimated space required is. Perhaps there is a requirement for a large amount of space whilst completing the backups, but this is going to cause issues for me potentially.

Looking at the messages (pasted below) my last backup took up 53GB, but the estimate for a backup is 148GB! I assume that it is calculated by looking at /var/www and then using a 3x multiple. This is likely a little high? The way I see it, we take a copy of that location, and we then create an archive of the location, so worst case it is going to 2x /var/www + whatever the DBs take up. Perhaps for smaller sites 3x /var/www works, but for larger sites, it doesn't make sense.

"You have 1 local backups occupying 53017 MB of space.

Estimated backup size [148188 MB] LARGER than available disk space [138618 MB]."

18.04 LTS install

Enter hostname [fqdn]:hula.host
Adding repository for MySQL, please wait...
Adding repository for NGINX, please wait...
Adding repository for PHP, please wait...
Updating apt-cache, please wait...
Installing packages, please wait...
Oops Something went wrong!!
Check logs for reason `tail /var/log/ee/ee.log` & Try Again!!!

/root/openspace42/dna/functions/install_easyengine: line 38: cd: /var/www/22222/htdocs/db/pma: No such file or directory
root@ubuntu-s-2vcpu-2gb-sfo2-01:~#

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

Fails on a brand new exclusive VPS and initial install with 18.04 LTS here Nick.

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.