Sisyphus Mirror Py
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
# Add command
ln -s /opt/sisyphus-mirror/venv/bin/sisyphus-mirror /usr/local/sbin/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 paths for finding and creating hard links to unchanged files.
linkdest_list = []
# 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/default.toml
Modify configuration if needed:
nano /etc/sisyphus-mirror/default.toml
Test Run
Dry-run synchronization with detailed output:
sudo -u sisyphus-mirror sisyphus-mirror --dry-run --verbose
Ensure that the reported total size fits the available disk space.
Production Run
Actual synchronization:
sudo -u sisyphus-mirror sisyphus-mirror
Systemd Integration
# systemd service unit:
echo '[Unit]
Description=sisyphus-mirror service
Wants=sisyphus-mirror.timer
[Service]
Type=oneshot
User=sisyphus-mirror
Group=sisyphus-mirror
ExecStart=sisyphus-mirror
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
Example for a previously unconfigured rsync installation:
echo 'port = 873
uid = 65534
gid = 65534
# Using chroot is required
use chroot = yes
max connections = 30
[altlinux]
path = /srv/mirrors/altlinux
read only = yes
list = yes' > /etc/rsyncd.conf
systemctl enable rsync
systemctl restart rsync
Serving via Nginx
Example for a previously unconfigured Nginx installation:
echo 'server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location /altlinux/ {
alias /srv/mirrors/altlinux/;
index off;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
try_files $uri $uri/ =404;
}
}' > /etc/nginx/sites-available/altlinux
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/altlinux /etc/nginx/sites-enabled/altlinux
systemctl enable nginx
systemctl restart nginx
Release files for sisyphus-mirror 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sisyphus_mirror-1.2.0.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sisyphus_mirror-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / sisyphus_mirror-1.2.0.tar.gz
| Download URL | sisyphus_mirror-1.2.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d9a85d0733f6b5e34ff7bfc69244f44ff8bb390a285bf2576e8fee9e2e9e43e
|
|
BLAKE2b-256 checksum How to use checksums |
2c2d0dc1d4996350073adc3e8c55695f686d14e7b980558d92f6a1c4ad8b6c68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Release files / sisyphus_mirror-1.2.0-py3-none-any.whl
| Download URL | sisyphus_mirror-1.2.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2920892578af4a967923adaf2cc26fdb7e2fb2a3ad2787c5b456c02d1e758d65
|
|
BLAKE2b-256 checksum How to use checksums |
11296be98b5a08c76a08c3d99b4b871e5f3a6017391fd3c984afeaa4d4b17db0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|