# 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
Raw data
{
"_id": null,
"home_page": "https://github.com/johnowhitaker/autobackup",
"name": "autobackup",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "nbdev jupyter notebook python",
"author": "Jonathan Whitaker",
"author_email": "johnowhitaker@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/83/6e/a7036afc03b7864194ab3bae7949fd0c6981de98305cee967ffe280f5137/autobackup-0.0.4.tar.gz",
"platform": null,
"description": "# autobackup\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Usage\n\n### Installation\n\nInstall latest from the GitHub\n[repository](https://github.com/johnowhitaker/autobackup):\n\n``` sh\n$ pip install git+https://github.com/johnowhitaker/autobackup.git\n```\n\nor from [pypi](https://pypi.org/project/autobackup/)\n\n``` sh\n$ pip install autobackup\n```\n\n## How to use\n\n`autobackup src dest` will make a copy of `src` (which can be a file or\na directory) inside `dir` in a folder with the current date+time, and\nclean up any old backups based on the following rules:\n\n- The most recent 5 backups are kept\n- For each number of days in `--max_ages` (default is \u201c2,14,60\u201d) the\n oldest one below that age is kept.\n\nThis ensures that you have a few recent backups, one up to 2 days old,\none up to 2 weeks old and one up to 2 months old.\n\nTo run this script hourly,\n\n1. Create a service file (e.g.\u00a0`/etc/systemd/system/backup.service`):\n\n<!-- -->\n\n [Unit]\n Description=Hourly Backup Service\n\n [Service]\n ExecStart=autobackup /path/to/src /path/to/dest\n\n [Install]\n WantedBy=multi-user.target\n\n2. Create a timer file (e.g.\u00a0`/etc/systemd/system/backup.timer`):\n\n<!-- -->\n\n [Unit]\n Description=Run Backup Service Hourly\n\n [Timer]\n OnCalendar=hourly\n\n [Install]\n WantedBy=timers.target\n\n3. Enable and start the timer:\n\n<!-- -->\n\n sudo systemctl enable backup.timer\n sudo systemctl start backup.timer\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Automatically create backups of a directory",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/johnowhitaker/autobackup"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a85b241f903e42d353f44e86f28697d9502687da793a3d592f9f2a80b20ea7f5",
"md5": "bd2d6b3d582be0f9152513d537e00f35",
"sha256": "fcd6a940eca23b4a7f12ae37451a94027a5c0ac9ef6a1748f5ad1e5b9554f810"
},
"downloads": -1,
"filename": "autobackup-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bd2d6b3d582be0f9152513d537e00f35",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8557,
"upload_time": "2024-11-27T23:40:34",
"upload_time_iso_8601": "2024-11-27T23:40:34.369637Z",
"url": "https://files.pythonhosted.org/packages/a8/5b/241f903e42d353f44e86f28697d9502687da793a3d592f9f2a80b20ea7f5/autobackup-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "836ea7036afc03b7864194ab3bae7949fd0c6981de98305cee967ffe280f5137",
"md5": "937941992aac7131a4a0b35d741457bd",
"sha256": "256b56319c5a424904548e4850a785e8d0930d534cc4fd9a614652ceef2a4fa7"
},
"downloads": -1,
"filename": "autobackup-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "937941992aac7131a4a0b35d741457bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9258,
"upload_time": "2024-11-27T23:40:35",
"upload_time_iso_8601": "2024-11-27T23:40:35.387187Z",
"url": "https://files.pythonhosted.org/packages/83/6e/a7036afc03b7864194ab3bae7949fd0c6981de98305cee967ffe280f5137/autobackup-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 23:40:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "johnowhitaker",
"github_project": "autobackup",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "autobackup"
}