Code Monkey home page Code Monkey logo

backupcpy's Introduction

backupcpy

backupcpy is a tiny and elegant backup archive assembler implemented in less than 300 lines of Python code. It is designed to assemble lists of files and create archives. That is all it does.

  • Simple YAML based configuration.
  • Support for collections of files producing separate archives.
  • Point-in-time tarballs (.tar.gz, tar.xz, tar.bz2).
  • Support for uncompressed archives (plain tarballs).
  • Ability to ignore files using Unix shell-style wildcards.

Requirements

You should have Python3 and pip3 installed on your system. Python 2 is not supported and will not work.

Installation

You can install backupcpy using pip - sudo pip3 install backupcpy

Backup manifest

Backup manifest is a file that contains lists directory and file paths you want to archive - collections. Each collection can have any number of files and directories attached to it and each collection produces a single backup archive.

By default, backupcpy will look for a file called .backupcpy.yml in your home directory. You can tell it to use a different file using --manifest command line option.

Manifest entries will also have some basic placeholders available for you to use.

Example manifest

# Example configuration file for backupcpy
#
# Available placeholders:
# {{now}} - current datetime in format %Y%m%d-%H%M%S-%f
# {{cwd}} - current working directory
# {{home}} - home directory of the current user
# {{user}} - username of the current user

# Global ignore - matches in ALL collections
# The format is Unix shell-style wildcards.
# Ignore is matched against absolute resolved path of each file.
# This works slightly differently than .gitignore.
ignore:
  - '*node_modules*' # Anywhere in the path

# Collections of things to backup
collections:
  personal:
    # What compression to use 'none', 'gz', 'xz', 'bz2'
    compress: 'gz'
    # Where to store backup archives (absolute path)
    target: '/mnt/backup-drive'
    # Ignore for current collection
    ignore:
      - '*.git*'
      - '*.idea*'
    # Items to backup - files, directories.
    # Defined using glob format.
    # Tilde is ignored - use {{home}} instead.
    items:
      - '{{home}}/Documents/**'
      - '{{home}}/Images/**'
      - '{{home}}/My Projects/**'

Usage

backupcpy [-h] [--manifest MANIFEST] [--verbose] [--debug] [--quiet] collection [collection ...]

To create backup archives you need to invoke the backupcpy command line tool and provide it with list of names of the collections you want to create archives for.

You can optionally change status output modes and provide a different location for the backup manifest.

For example:

backupcpy personal projects other

Why?

I needed a simple tool to assemble point-in-time backups. I use backupcpy to assemble backup archives which are then automatically rsync'd to hot and cold networked storage.

If you are looking for a fully fledged backup system, you might want to look at Borg, Bacula or git-annex.

License

Licensed under terms and conditions of Apache 2.0 license.

backupcpy's People

Contributors

addvilz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.