Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnowhitaker/autobackup
Automatically create backups of a directory
https://github.com/johnowhitaker/autobackup
Last synced: about 2 months ago
JSON representation
Automatically create backups of a directory
- Host: GitHub
- URL: https://github.com/johnowhitaker/autobackup
- Owner: johnowhitaker
- License: apache-2.0
- Created: 2024-11-15T19:10:38.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-15T20:12:55.000Z (about 2 months ago)
- Last Synced: 2024-11-15T20:16:30.100Z (about 2 months ago)
- Language: Jupyter Notebook
- Homepage: https://johnowhitaker.github.io/autobackup
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# autobackup
## 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.target2. Create a timer file (e.g. `/etc/systemd/system/backup.timer`):
[Unit]
Description=Run Backup Service Hourly[Timer]
OnCalendar=hourly[Install]
WantedBy=timers.target3. Enable and start the timer:
sudo systemctl enable backup.timer
sudo systemctl start backup.timer