Metadata-Version: 2.1
Name: autobackup
Version: 0.0.4
Summary: Automatically create backups of a directory
Home-page: https://github.com/johnowhitaker/autobackup
Author: Jonathan Whitaker
Author-email: johnowhitaker@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev

# autobackup


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install latest from the GitHub
[repository](https://github.com/johnowhitaker/autobackup):

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

or from [pypi](https://pypi.org/project/autobackup/)

``` sh
$ 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

2.  Create a timer file (e.g. `/etc/systemd/system/backup.timer`):

<!-- -->

    [Unit]
    Description=Run Backup Service Hourly

    [Timer]
    OnCalendar=hourly

    [Install]
    WantedBy=timers.target

3.  Enable and start the timer:

<!-- -->

    sudo systemctl enable backup.timer
    sudo systemctl start backup.timer
