Skip to main content

A modern Python implementation of the tool for mirroring the Sisyphus repository.

Project description

English | Русский

A modern Python implementation of the tool for mirroring the Sisyphus repository.

The project is inspired by the original utility sisyphus-mirror.

Technical Requirements

  • GNU/Linux OS

  • Python 3.12+

  • RSync 3.2+

  • 110+ GB of free disk space

Installation

# Create dedicated user and directories:
useradd -rMU -d /opt/sisyphus-mirror -s /usr/sbin/nologin sisyphus-mirror
mkdir -p /etc/sisyphus-mirror /opt/sisyphus-mirror /srv/mirrors/altlinux
chown sisyphus-mirror:sisyphus-mirror /opt/sisyphus-mirror
chown sisyphus-mirror:sisyphus-mirror /srv/mirrors/altlinux

# Create Python virtual environment and install the package:
sudo -u sisyphus-mirror python3 -m venv /opt/sisyphus-mirror/venv
sudo -u sisyphus-mirror /opt/sisyphus-mirror/venv/bin/pip install sisyphus-mirror

# Create TOML configuration file:
echo '[sisyphus-mirror]
dry_run = false
verbose = false
debug = false

# Explicitly defined repository branches.
branch_list = ["p11"]

# Repository source URL.
source_url = "rsync://ftp.altlinux.org/ALTLinux"

# Working directory for snapshots and temporary synchronization data.
working_dir = "/srv/mirrors/altlinux"

# Target CPU architectures.
arch_list = ["noarch", "x86_64", "x86_64-i586"]

# Additional file include patterns.
include_files = ["list/**", ".timestamp"]

# Additional file exclude patterns.
exclude_files = ["*debuginfo*", "SRPMS"]

# Maximum number of snapshots per branch.
snapshot_limit = 1

# Limiting network I/O bandwidth.
rate_limit = "5m"

# Connection timeout (seconds).
conn_timeout = 60

# I/O timeout (seconds).
io_timeout = 600' > /etc/sisyphus-mirror/sisyphus-mirror.toml

Modify configuration if needed:

nano /etc/sisyphus-mirror/sisyphus-mirror.toml

Test Run

Dry-run synchronization with detailed output:

sudo -u sisyphus-mirror \
  /opt/sisyphus-mirror/venv/bin/sisyphus-mirror \
  --dry-run \
  --verbose \
  --config /etc/sisyphus-mirror/sisyphus-mirror.toml

Ensure that the reported total size fits the available disk space.

Production Run

Actual synchronization:

sudo -u sisyphus-mirror \
  /opt/sisyphus-mirror/venv/bin/sisyphus-mirror \
  --config /etc/sisyphus-mirror/sisyphus-mirror.toml

Systemd Integration

# systemd service unit:
echo '[Unit]
Description=sisyphus-mirror service
Wants=sisyphus-mirror.timer

[Service]
Type=oneshot
User=sisyphus-mirror
Group=sisyphus-mirror
WorkingDirectory=/opt/sisyphus-mirror
ExecStart=/opt/sisyphus-mirror/venv/bin/sisyphus-mirror -c /etc/sisyphus-mirror/sisyphus-mirror.toml
ProtectHome=true
ProtectSystem=true
SyslogIdentifier=sisyphus-mirror

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/sisyphus-mirror.service

# Daily timer:
echo '[Unit]
Description=Periodic run of sisyphus-mirror

[Timer]
# Run at a random time between 00:15 and 07:45 local server time
OnCalendar=*-*-* 00:15:00
RandomizedDelaySec=7h 30min
Persistent=true
Unit=sisyphus-mirror.service

[Install]
WantedBy=timers.target' > /etc/systemd/system/sisyphus-mirror.timer

# Reloading systemd configuration and activating the timer:
systemctl daemon-reload
systemctl enable --now sisyphus-mirror.timer

Serving via rsyncd

echo 'port = 873
uid = 65534
gid = 65534
use chroot = yes
max connections = 30

[altlinux]
path = /srv/mirrors/altlinux
read only = yes
list = yes' > /etc/rsyncd.conf

systemctl enable --now rsync.service

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

sisyphus_mirror-1.0.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sisyphus_mirror-1.0.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file sisyphus_mirror-1.0.0.tar.gz.

File metadata

  • Download URL: sisyphus_mirror-1.0.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for sisyphus_mirror-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6c16e3be54184e86e3560542a4c24f1356e6016298e76afcb1e527255785926
MD5 be5758a99377b8e21ef4f06c780cc263
BLAKE2b-256 9a83e2b857aadba43dd64dd15b5e45c415378e520be6d1bbde6468efe437aac3

See more details on using hashes here.

File details

Details for the file sisyphus_mirror-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sisyphus_mirror-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c07fed827f422af8520891643b63250bdea6703c5c773af7cb385c8aab9d3536
MD5 d01bf7e718569e74f2dee8ea0c3e98fd
BLAKE2b-256 66ddc6e8074ddc0f3ab68a80a81d663abce0d2a3d61db81f67940c1525b5324a

See more details on using hashes here.

Supported by

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