Code Monkey home page Code Monkey logo

mantis-backup-downloader's Introduction

Cronjob-capable shell script to download backups from Mantis bugtracker

This script:

  • automatically logs in to Mantis, see section "Configuration" in the script.
  • tells Mantis to create a fresh backup.
  • checks whether the date of the backup as reported by Mantis matches the local time to ensure backup creation worked.
  • downloads the backup into a directory called YYYY-MM-DD, or fails if it already exists.
  • tests the CRCs of the zip files of the backup.
  • sets the timestamps of the zip files to that of the newest contained file.
  • aborts with non-zero exit code and prints an error if any of the above fails. If your have a working mail command available on your system cron daemons such as anachron will typically mail this output to you.
  • prints nothing upon success to ensure you don't get unnecessary emails from cron.

Notice: As of 2018 it seems the feature to create a backup on the web interface is only available on MantisHub, not in stock Mantis. Hence this script likely only will work with MantisHub.

Script for encrypting the backups

As a bonus feature the script encrypt-mantis-backup can be used to:

  • encrypt the backup of the current day to a recipient's GPG key and create a signature file (make sure the user which runs it has a GPG private key which is not password protected!).
  • automatically download the recipient's GPG key at every run to check for revocation.
  • place the encrypted and signed backup in a different directory, and set the permissions of the directory / files as specified. This e.g. allows putting the encrypted backup on a web server for distribution.

Dependencies

apt-get install bash wget grep unzip gnupg

Configuration

Please make sure to populate the scripts' Configuration sections before using them, they cannot be used without configuration.

You can configure the scripts to run in a cronjob if you obey the following:

  • don't run more often than once per day. Don't run close to midnight. These are necessary as the scripts use the current day as directory names and validate whether the date matches the date which Mantis claims the backup is from.
  • ideally create a separate user account to contain the scripts so there can be a single non-password-protected key for the encrypt-mantis-backup script.

mantis-backup-downloader's People

Contributors

xor-freenet avatar

Watchers

 avatar  avatar

Forkers

thynix

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.