rebade


Namerebade JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/johndoe31415/rebade
SummaryRestic backup daemon: a friendly frontend for restic
upload_time2024-04-23 19:36:35
maintainerNone
docs_urlNone
authorJohannes Bauer
requires_pythonNone
licensegpl-3.0
keywords restic backup daemon
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rebade
rebade is the Restic Backup Daemon, a friendly frontend for restic. It uses a central JSON configuration
file to manage sources and targets and allows invocation by calling those repositories by name. This
makes it easier to remember complex syntax for repository URIs and such.

It additionally has a daemon component which monitors and tracks user activity
of a system. This enables it to execute a restic system backup after a specific
amount of *activity*. In other words, it is easy to setup a cron job to create
a backup every 6 hours, but rebade only backs up after 6 hours of *work* time,
i.e., time in which there was some input to the system. Activity time is also
persisted (unlike [systemd timers](https://github.com/systemd/systemd/issues/3107)
unfortunately).

## Configuration
There is a configuration file that usually is located in
`/etc/rebade/config.json`. It may look something like this, which is fairly
close to the backup configuration I'm running myself:

```json
{
	"plans": {
		"system-backup": {
			"default": true,
			"source": {
				"paths": [
					"/"
				],
				"exclude": [
					"/proc",
					"/sys",
					"/dev",
					"/var/cache/apt/archives",
					"/run/user",
					"/tmp",
					"/mnt",
					"/media",
					"/run/snapd",
					"/home/joe/.steam/steamapps/common",
					"/home/joe/.cache",
					"/root/.cache"
				]
			},
			"target": {
				"method": "sftp",
				"username": "joe",
				"hostname": "my-backup-server.com",
				"remote_path": "/backup/joe/restic"
			},
			"post_hooks": [
				{
					"method": "http_get",
					"condition": "success",
					"uri": "https://hc-ping.com/ba789f38-cc2f-4f09-8b17-d48c5b99247a"
				}
			],
			"keyfile": "/etc/rebade/backup_key.txt",
			"soft_period_secs": 18000,
			"hard_period_secs": 21600
		}
	}
}
```

Multiple "plans" may be specified, but this configuration knows only one, which
centrally backs up the whole system. When running in daemonized mode, a backup
is started after the period. Note there are two values here, one is set to 5
hours and the other to 6 hours.

What this means is that as soon as the "soft" period is reached, a backup is
triggered only if the user is now absent (no activity recoded for a period of
at least 5 minutes). As soon as the "hard" period is reached, a backup is
triggered in any case. The idea behind this is that when you leave your
computer for a lunch break and we *could* do a backup, do it while the user is
away. After some threshold is reached, perform a backup either way. Note that
the backup is running with minimal nice and ionice settings to be as
non-intrusive as possible.

Also note that after a successful backup, we notify a third-party service so
that we can monitor if backups fail for some reason.

## Usage
If you want to configure daemon mode, place a configuration file and then run:

```
# rebade daemon -a install
```

Which will install and activate a corresponding systemd unit.

## License
GNU GPL-3.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/johndoe31415/rebade",
    "name": "rebade",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "restic, backup, daemon",
    "author": "Johannes Bauer",
    "author_email": "joe@johannes-bauer.com",
    "download_url": "https://files.pythonhosted.org/packages/03/30/7a511003d1ca361020fa9d178ac2d8496c16b0c2d39ad7847fb0ca3c49f7/rebade-0.0.1.tar.gz",
    "platform": null,
    "description": "# rebade\nrebade is the Restic Backup Daemon, a friendly frontend for restic. It uses a central JSON configuration\nfile to manage sources and targets and allows invocation by calling those repositories by name. This\nmakes it easier to remember complex syntax for repository URIs and such.\n\nIt additionally has a daemon component which monitors and tracks user activity\nof a system. This enables it to execute a restic system backup after a specific\namount of *activity*. In other words, it is easy to setup a cron job to create\na backup every 6 hours, but rebade only backs up after 6 hours of *work* time,\ni.e., time in which there was some input to the system. Activity time is also\npersisted (unlike [systemd timers](https://github.com/systemd/systemd/issues/3107)\nunfortunately).\n\n## Configuration\nThere is a configuration file that usually is located in\n`/etc/rebade/config.json`. It may look something like this, which is fairly\nclose to the backup configuration I'm running myself:\n\n```json\n{\n\t\"plans\": {\n\t\t\"system-backup\": {\n\t\t\t\"default\": true,\n\t\t\t\"source\": {\n\t\t\t\t\"paths\": [\n\t\t\t\t\t\"/\"\n\t\t\t\t],\n\t\t\t\t\"exclude\": [\n\t\t\t\t\t\"/proc\",\n\t\t\t\t\t\"/sys\",\n\t\t\t\t\t\"/dev\",\n\t\t\t\t\t\"/var/cache/apt/archives\",\n\t\t\t\t\t\"/run/user\",\n\t\t\t\t\t\"/tmp\",\n\t\t\t\t\t\"/mnt\",\n\t\t\t\t\t\"/media\",\n\t\t\t\t\t\"/run/snapd\",\n\t\t\t\t\t\"/home/joe/.steam/steamapps/common\",\n\t\t\t\t\t\"/home/joe/.cache\",\n\t\t\t\t\t\"/root/.cache\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"target\": {\n\t\t\t\t\"method\": \"sftp\",\n\t\t\t\t\"username\": \"joe\",\n\t\t\t\t\"hostname\": \"my-backup-server.com\",\n\t\t\t\t\"remote_path\": \"/backup/joe/restic\"\n\t\t\t},\n\t\t\t\"post_hooks\": [\n\t\t\t\t{\n\t\t\t\t\t\"method\": \"http_get\",\n\t\t\t\t\t\"condition\": \"success\",\n\t\t\t\t\t\"uri\": \"https://hc-ping.com/ba789f38-cc2f-4f09-8b17-d48c5b99247a\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"keyfile\": \"/etc/rebade/backup_key.txt\",\n\t\t\t\"soft_period_secs\": 18000,\n\t\t\t\"hard_period_secs\": 21600\n\t\t}\n\t}\n}\n```\n\nMultiple \"plans\" may be specified, but this configuration knows only one, which\ncentrally backs up the whole system. When running in daemonized mode, a backup\nis started after the period. Note there are two values here, one is set to 5\nhours and the other to 6 hours.\n\nWhat this means is that as soon as the \"soft\" period is reached, a backup is\ntriggered only if the user is now absent (no activity recoded for a period of\nat least 5 minutes). As soon as the \"hard\" period is reached, a backup is\ntriggered in any case. The idea behind this is that when you leave your\ncomputer for a lunch break and we *could* do a backup, do it while the user is\naway. After some threshold is reached, perform a backup either way. Note that\nthe backup is running with minimal nice and ionice settings to be as\nnon-intrusive as possible.\n\nAlso note that after a successful backup, we notify a third-party service so\nthat we can monitor if backups fail for some reason.\n\n## Usage\nIf you want to configure daemon mode, place a configuration file and then run:\n\n```\n# rebade daemon -a install\n```\n\nWhich will install and activate a corresponding systemd unit.\n\n## License\nGNU GPL-3.\n",
    "bugtrack_url": null,
    "license": "gpl-3.0",
    "summary": "Restic backup daemon: a friendly frontend for restic",
    "version": "0.0.1",
    "project_urls": {
        "Download": "https://github.com/johndoe31415/rebade/archive/v0.0.1.tar.gz",
        "Homepage": "https://github.com/johndoe31415/rebade"
    },
    "split_keywords": [
        "restic",
        " backup",
        " daemon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03307a511003d1ca361020fa9d178ac2d8496c16b0c2d39ad7847fb0ca3c49f7",
                "md5": "62bc00822fe18436f0c5c2ee70d6afd9",
                "sha256": "18c6970a6579fe7f602cf148d9dc1e4661f3978324a7c8733b4948c09d132434"
            },
            "downloads": -1,
            "filename": "rebade-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "62bc00822fe18436f0c5c2ee70d6afd9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14394,
            "upload_time": "2024-04-23T19:36:35",
            "upload_time_iso_8601": "2024-04-23T19:36:35.235501Z",
            "url": "https://files.pythonhosted.org/packages/03/30/7a511003d1ca361020fa9d178ac2d8496c16b0c2d39ad7847fb0ca3c49f7/rebade-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-23 19:36:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "johndoe31415",
    "github_project": "rebade",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rebade"
}
        
Elapsed time: 0.24348s