seafile-mirror


Nameseafile-mirror JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://src.mehl.mx/mxmehl/seafile-mirror
SummaryHandle clean read-only (re-)syncs of Seafile libraries to mirror them
upload_time2023-09-22 08:17:25
maintainer
docs_urlNone
authorMax Mehl
requires_python>=3.10,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>

SPDX-License-Identifier: Apache-2.0
-->

# Seafile Mirror

[![REUSE status](https://api.reuse.software/badge/src.mehl.mx/mxmehl/seafile-mirror)](https://api.reuse.software/info/src.mehl.mx/mxmehl/seafile-mirror)

A Python tool to handle clean read-only (re-)syncs of
[Seafile](https://www.seafile.com) libraries with the intention to mirror them.

## Overview

If you have Seafile libraries, you may want to back them up in a safe place
automatically.

One option is to snapshot/backup the whole server on which the library is
stored. However, in some situations, this may not be feasible or even not
possible.

This is why this repository offers a different way: you can define one or
multiple Seafile libraries that shall be downloaded to a local directory. These
libraries can belong to the same or a different user, and even on different
Seafile servers!

## Features

* Download/sync defined libraries in customisable intervals
* De-sync libaries immediately after they have been downloaded to avoid sync
  errors
* Allow to force-re-sync a library even if its re-sync interval hasn't reached
  yet
* Extensive informative and error logging
* Created with automation in mind so you can run it in cronjobs or systemd
  triggers
* Deal with the numerous caveats of `seaf-cli` and Seafile in general


## Install

The tool depends on the following applications:
* `Python 3`
* `poetry` (e.g. by `pip3 install poetry`)
* [`seafile-cli`](https://help.seafile.com/syncing_client/linux-cli/), available
  e.g. in [Debian](https://packages.debian.org/bullseye/seafile-cli)

You can execute the tool with `poetry run seafile-mirror`. The `--help` flag
informs you about the required and available commands.

There is also an [Ansible
role](https://src.mehl.mx/mxmehl/seafile-mirror-ansible) that takes care of
installing the tool, setting up a systemd service, and running it daily.

To keep the Seafile daemon that is required for `seafile-cli` running in the
background, check out this [exemplary systemd
service](examples/seaf-daemon.service).

## Configuration

Configuration is done in a YAML file called `seafile_mirror.conf.yaml`. You can
find an example [here](examples/seafile_mirror.conf.yaml).

If that configuration file resides in the same location your current working
directory, you should provide `--configdir ./`.

## Logging and caching

The tool creates `seafile_mirror.log` in addition to the log to the standard
output in the configuration directory. With `-v` you can print DEBUG messages
that will help you in case of problems.

It also caches the current status of synced libraries and their latest full
download in the file `.seafile_mirror.db.json`. Do not delete this file unless
you don't mind that the tool will re-sync all libraries in the next run.

            

Raw data

            {
    "_id": null,
    "home_page": "https://src.mehl.mx/mxmehl/seafile-mirror",
    "name": "seafile-mirror",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Max Mehl",
    "author_email": "mail@mehl.mx",
    "download_url": "https://files.pythonhosted.org/packages/00/d1/adf220ccb07d9590b4eaf354fdf3fc5256089baaaf14f2dcc7a872cf5b29/seafile_mirror-0.1.0.tar.gz",
    "platform": null,
    "description": "<!--\nSPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>\n\nSPDX-License-Identifier: Apache-2.0\n-->\n\n# Seafile Mirror\n\n[![REUSE status](https://api.reuse.software/badge/src.mehl.mx/mxmehl/seafile-mirror)](https://api.reuse.software/info/src.mehl.mx/mxmehl/seafile-mirror)\n\nA Python tool to handle clean read-only (re-)syncs of\n[Seafile](https://www.seafile.com) libraries with the intention to mirror them.\n\n## Overview\n\nIf you have Seafile libraries, you may want to back them up in a safe place\nautomatically.\n\nOne option is to snapshot/backup the whole server on which the library is\nstored. However, in some situations, this may not be feasible or even not\npossible.\n\nThis is why this repository offers a different way: you can define one or\nmultiple Seafile libraries that shall be downloaded to a local directory. These\nlibraries can belong to the same or a different user, and even on different\nSeafile servers!\n\n## Features\n\n* Download/sync defined libraries in customisable intervals\n* De-sync libaries immediately after they have been downloaded to avoid sync\n  errors\n* Allow to force-re-sync a library even if its re-sync interval hasn't reached\n  yet\n* Extensive informative and error logging\n* Created with automation in mind so you can run it in cronjobs or systemd\n  triggers\n* Deal with the numerous caveats of `seaf-cli` and Seafile in general\n\n\n## Install\n\nThe tool depends on the following applications:\n* `Python 3`\n* `poetry` (e.g. by `pip3 install poetry`)\n* [`seafile-cli`](https://help.seafile.com/syncing_client/linux-cli/), available\n  e.g. in [Debian](https://packages.debian.org/bullseye/seafile-cli)\n\nYou can execute the tool with `poetry run seafile-mirror`. The `--help` flag\ninforms you about the required and available commands.\n\nThere is also an [Ansible\nrole](https://src.mehl.mx/mxmehl/seafile-mirror-ansible) that takes care of\ninstalling the tool, setting up a systemd service, and running it daily.\n\nTo keep the Seafile daemon that is required for `seafile-cli` running in the\nbackground, check out this [exemplary systemd\nservice](examples/seaf-daemon.service).\n\n## Configuration\n\nConfiguration is done in a YAML file called `seafile_mirror.conf.yaml`. You can\nfind an example [here](examples/seafile_mirror.conf.yaml).\n\nIf that configuration file resides in the same location your current working\ndirectory, you should provide `--configdir ./`.\n\n## Logging and caching\n\nThe tool creates `seafile_mirror.log` in addition to the log to the standard\noutput in the configuration directory. With `-v` you can print DEBUG messages\nthat will help you in case of problems.\n\nIt also caches the current status of synced libraries and their latest full\ndownload in the file `.seafile_mirror.db.json`. Do not delete this file unless\nyou don't mind that the tool will re-sync all libraries in the next run.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Handle clean read-only (re-)syncs of Seafile libraries to mirror them",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://src.mehl.mx/mxmehl/seafile-mirror",
        "Repository": "https://src.mehl.mx/mxmehl/seafile-mirror"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c73b3fc88516b28f75547317243fdc403f877a3f877ccc7c2d4f669ad86e3931",
                "md5": "883e375b2ce4d71722ae952ec5e4b200",
                "sha256": "016d7eabfd219ae8a5575451f403a98424c5bafb2b26917236cc70519eaa649d"
            },
            "downloads": -1,
            "filename": "seafile_mirror-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "883e375b2ce4d71722ae952ec5e4b200",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 14584,
            "upload_time": "2023-09-22T08:17:23",
            "upload_time_iso_8601": "2023-09-22T08:17:23.968970Z",
            "url": "https://files.pythonhosted.org/packages/c7/3b/3fc88516b28f75547317243fdc403f877a3f877ccc7c2d4f669ad86e3931/seafile_mirror-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "00d1adf220ccb07d9590b4eaf354fdf3fc5256089baaaf14f2dcc7a872cf5b29",
                "md5": "3a1c31a610a6c074a3f0f84a6338b6f5",
                "sha256": "0997decbbba889a95065e5523d4720ddf89eccefee50182156ce453ddaab15e7"
            },
            "downloads": -1,
            "filename": "seafile_mirror-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3a1c31a610a6c074a3f0f84a6338b6f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 9707,
            "upload_time": "2023-09-22T08:17:25",
            "upload_time_iso_8601": "2023-09-22T08:17:25.832491Z",
            "url": "https://files.pythonhosted.org/packages/00/d1/adf220ccb07d9590b4eaf354fdf3fc5256089baaaf14f2dcc7a872cf5b29/seafile_mirror-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-22 08:17:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "seafile-mirror"
}
        
Elapsed time: 0.16126s