Project

trashman

0.0
No commit activity in last 3 years
No release in over 3 years
Removes outdated periodic backup files from your cloud storage bucket
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.0

Runtime

~> 1.34
~> 0.19
 Project Readme

TrashMan

Build Status

Removes outdated periodic backup files from your cloud storage bucket.

Install

Into Gemfile from rubygems.org:

gem install trashman

Note

This gem assumes your filenames include a date and time e.g. backup.2015-07-07T10-32-01.tar.gz.

backup.$(date +'\%Y-\%m-\%dT\%H-\%M-\%S').tar.gz

Please use the --dry-run option to test your configuration before using trashman.

Usage

trashman is best used as a cronjob. It assumes you have a cloud storage bucket where you store periodic backups with conventional filenames including date and time.

To destroy outdated backups:

trashman prune --provider <FOG PROVIDER> --keep <NUMBER OF FILES TO KEEP> --container <CONTAINER/BUCKET> --credentials username:<USERNAME> password:<PASSWORD>

trashman prune --provider rackspace --keep 100 --container "Test Container" --credentials rackspace_api_key:abc123 rackspace_username:example rackspace_region:ord

trashman help prune

Usage:
  trashman prune --credentials=key:value -P, --provider=PROVIDER -c, --container=CONTAINER

Options:
  -P, --provider=PROVIDER          # A valid fog provider e.g. rackspace, aws, etc.
  -c, --container=CONTAINER        # Container or bucket on fog provider.
  -k, [--keep=N]                   # Number of files to keep.
                                   # Default: 100
      --credentials=key:value      # Credentials for your fog provider (depends on fog provider).
      [--dry-run], [--no-dry-run]  # As normal, but it does not destroy old backups.
      [--pattern=PATTERN]          # A regular expression to only consider
matching filenames for pruning.

Contributors

Many thanks to:

How to contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Write your tests and check everything passes
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request (into the master branch)

License

Please refer to LICENSE.md.