Skip to main content

A collection of high-level utility scripts for moving data to and from offline archival storage using XRootD.

Project description

XRootD Utils

A collection of high-level utility scripts for moving data to and from offline archival storage using XRootD.

Environment setup

Other platforms may need to use different names to get the equivalent packages.

Rocky 9

sudo dnf install "@Development Tools" python3.11 python3.11-pip python3.11-setuptools python3.11-devel openldap-devel swig gcc gcc-c++ openssl-devel cmake3 libuv libuuid-devel git

Debian 12

sudo agt-get update
sudo apt-get install build-essential curl python3.11 python3.11-venv python3.11-dev python3-pip libldap2-dev libsasl2-dev cmake uuid-dev git

Usage

Authentication

XRootD uses environment variables to define the credentials used to authenticate to the server. Note that files containing keys need to be only readable/writable by the user, so it may be necessary to manually configure this:

chmod 600 /path/to/.keytab

Keytab

export XrdSecPROTOCOL=sss
export XrdSecSSSKT=/path/to/.keytab

X509 certificates

export X509_USER_CERT=/path/to/hostcert.pem
export X509_USER_KEY=/path/to/hostkey.pem

Commandline

xrootd-utils --help
usage: xrootd-utils [-h] [--verbose] url {backup,restore} ...

positional arguments:
  url               Url for remote XRootD server including top level directory path, for example root://hostname.domain:1094//path/to/directory
  {backup,restore}
    backup          Backup files in local directory to tape.
    restore         Restore files in a remote directory to tape

options:
  -h, --help        show this help message and exit
  --verbose, -v     Increase logging level to DEBUG.

Backup

xrootd-utils root://localhost:1094 backup --help
usage: xrootd-utils url backup [-h] [--auto-remove {never,backed_up,cached}] source

positional arguments:
  source                Local source path. Directories will be walked to find all nested files.

options:
  -h, --help            show this help message and exit
  --auto-remove {never,backed_up,cached}, -r {never,backed_up,cached}
                        Whether to automatically remove the local copy of a file: 'never', only when the XRootD server has it 'backed_up', or as soon as the server has a 'cached' copy.

Restore

xrootd-utils root://localhost:1094 restore --help
usage: xrootd-utils url restore [-h] [--poll-seconds POLL_SECONDS] [--auto-evict] source target

positional arguments:
  source                Remote relative source path. Directories will be walked to find all nested files.
  target                Local directory to restore relative paths to.

options:
  -h, --help            show this help message and exit
  --poll-seconds POLL_SECONDS, -s POLL_SECONDS
                        Number of seconds to wait between querying to see if requested files are online.
  --auto-evict, -e      Once copied to local storage, automatically evict the online copy cached on the remote server.

As a library

from xrootd_utils.client import Client

client = Client("root://localhost:1094//")
client.backup("local/directory")

Development

It's recommended to use poetry to manage dependencies and virtual environments, however manually managing the development environment is also possible.

python -m venv .venv
poetry install  # Note that as XRootD needs to be compiled at install time, this can take ~5 minutes
source .venv/bin/activate

Formatting

black .

Linting

flake8 xrootd_utils test

Package vulnerabilities

safety check --full-report

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

xrootd_utils-0.1.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

xrootd_utils-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file xrootd_utils-0.1.1.tar.gz.

File metadata

  • Download URL: xrootd_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for xrootd_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5a602c0f9a2c48247cb14de201f617782c09399d82c4d055f0dabe18d006641
MD5 b1f744a446c7458b226d4b0d93d32c35
BLAKE2b-256 6a355d2df850cc67dea938f0f36093779b14ee3c32b2dfafb1d310c80ecbba63

See more details on using hashes here.

File details

Details for the file xrootd_utils-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xrootd_utils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for xrootd_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 161f62f083f0ebe12421e04b5053ced0208c65fef5c5b598314898e6afea11ae
MD5 9cb0964fa7a8685307a0667c10548d82
BLAKE2b-256 7b2f835b8155cdbed9433505dea7ac7a0732e59958475487475ab684561b6f1e

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