Skip to content

SaltaIT/eyp-tarbackup

Repository files navigation

tarbackup

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage
  5. Reference
  6. Limitations
  7. Development

Overview

file backup script management

Module Description

This module manages include/excludes for a file backup script using tar

Setup

What tarbackup affects

  • backup script installation (managed using tarbackup)
  • backup configuration files (managed using tarbackup::instance)
  • backup cronjobs (managed using tarbackup::instance)

Setup Requirements OPTIONAL

This module requires pluginsync enabled

Beginning with tarbackup

basic example:

class { 'tarbackup':
}

tarbackup::instance { 'coses':
  includedir => '/etc',
  includedir => '/etc/apache2',
  xdev => true,
  destination => '/backup/tarbackup',
}

This will create the following files:

  • /usr/local/bin/tarbackup.sh
  • /usr/local/bin/tarbackup_coses.config

And add the following cronjob:

# Puppet Name: cronjob tarball backup tarbackup
0 2 * * * /usr/local/bin/tarbackup.sh /usr/local/bin/tarbackup_coses.config

Usage

Put the classes, types, and resources for customizing, configuring, and doing the fancy stuff with your module here.

Reference

classes

tarbackup

installs backup script

  • basedir: where to install this script (default: /usr/local/bin)
  • backupscript: script name (default: tarbackup)

define

tarbackup::instance

adds a cronjob por a given set of files to backup

  • includedir:
  • destination:
  • instancename: (default: resource's name)
  • backupname: (default: Files)
  • excludedir: (default: undef)
  • retention: (default: undef)
  • logdir: (default: undef)
  • mailto: (default: undef)
  • idhost: (default: undef)
  • hour: (default: 2)
  • minute: (default: 0)
  • month: (default: undef)
  • monthday: (default: undef)
  • weekday: (default: undef)
  • setcron: (default: true)
  • xdev: (default: false)

Limitations

Tested on:

  • CentOS 6
  • CentOS 7
  • Ubuntu 16.04

but should work anywhere where there is a /bin/bash installed

Development

We are pushing to have acceptance testing in place, so any new feature should have some test to check both presence and absence of any feature

TODO

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request