Skip to main content

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.

Metadata

Release files for backupcpy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for backupcpy 1.0.0
File Size Uploaded
backupcpy-1.0.0.tar.gz 9.0 kB Details

Release files / backupcpy-1.0.0.tar.gz

Download URL backupcpy-1.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
43a226e40a90e5438b7594a2bbfa20e1b0f52b3bdfc3d0eea56347fd4984d558
BLAKE2b-256 checksum
How to use checksums
9f0fa3fd7820d5c7d5cecdd9c93ce897880f5ef1adaef2b05cd7a8152465449a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page