Skip to main content

autobackup

Usage

Installation

Install latest from the GitHub repository:

$ pip install git+https://github.com/johnowhitaker/autobackup.git

or from pypi

$ pip install autobackup

How to use

autobackup src dest will make a copy of src (which can be a file or a directory) inside dir in a folder with the current date+time, and clean up any old backups based on the following rules:

  • The most recent 5 backups are kept
  • For each number of days in --max_ages (default is “2,14,60”) the oldest one below that age is kept.

This ensures that you have a few recent backups, one up to 2 days old, one up to 2 weeks old and one up to 2 months old.

To run this script hourly,

  1. Create a service file (e.g. /etc/systemd/system/backup.service):
[Unit]
Description=Hourly Backup Service

[Service]
ExecStart=autobackup /path/to/src /path/to/dest

[Install]
WantedBy=multi-user.target
  1. Create a timer file (e.g. /etc/systemd/system/backup.timer):
[Unit]
Description=Run Backup Service Hourly

[Timer]
OnCalendar=hourly

[Install]
WantedBy=timers.target
  1. Enable and start the timer:
sudo systemctl enable backup.timer
sudo systemctl start backup.timer

Release files for autobackup 0.0.4

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

Source distribution (sdist)

Source distribution for autobackup 0.0.4
File Size Uploaded
autobackup-0.0.4.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autobackup 0.0.4
File Interpreter ABI Platform
autobackup-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / autobackup-0.0.4.tar.gz

Download URL autobackup-0.0.4.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
256b56319c5a424904548e4850a785e8d0930d534cc4fd9a614652ceef2a4fa7
BLAKE2b-256 checksum
How to use checksums
836ea7036afc03b7864194ab3bae7949fd0c6981de98305cee967ffe280f5137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / autobackup-0.0.4-py3-none-any.whl

Download URL autobackup-0.0.4-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcd6a940eca23b4a7f12ae37451a94027a5c0ac9ef6a1748f5ad1e5b9554f810
BLAKE2b-256 checksum
How to use checksums
a85b241f903e42d353f44e86f28697d9502687da793a3d592f9f2a80b20ea7f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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