Skip to main content

Handle clean read-only (re-)syncs of Seafile libraries to mirror them

Project description

Seafile Mirror

REUSE status

A Python tool to handle clean read-only (re-)syncs of Seafile 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, available e.g. in Debian

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 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.

Configuration

Configuration is done in a YAML file called seafile_mirror.conf.yaml. You can find an example here.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seafile_mirror-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

seafile_mirror-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file seafile_mirror-0.1.0.tar.gz.

File metadata

  • Download URL: seafile_mirror-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for seafile_mirror-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0997decbbba889a95065e5523d4720ddf89eccefee50182156ce453ddaab15e7
MD5 3a1c31a610a6c074a3f0f84a6338b6f5
BLAKE2b-256 00d1adf220ccb07d9590b4eaf354fdf3fc5256089baaaf14f2dcc7a872cf5b29

See more details on using hashes here.

File details

Details for the file seafile_mirror-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: seafile_mirror-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for seafile_mirror-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 016d7eabfd219ae8a5575451f403a98424c5bafb2b26917236cc70519eaa649d
MD5 883e375b2ce4d71722ae952ec5e4b200
BLAKE2b-256 c73b3fc88516b28f75547317243fdc403f877a3f877ccc7c2d4f669ad86e3931

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page