{"id":32524023,"url":"https://github.com/ucphhpc/lustrebackup-mgs","last_synced_at":"2026-07-02T18:05:13.541Z","repository":{"id":262651629,"uuid":"887928330","full_name":"ucphhpc/lustrebackup-mgs","owner":"ucphhpc","description":"Lustre snapshot backup Management Service (MGS) tools ","archived":false,"fork":false,"pushed_at":"2026-03-10T11:45:14.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-10T18:42:34.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucphhpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T14:22:34.000Z","updated_at":"2026-03-10T11:45:17.000Z","dependencies_parsed_at":"2024-11-13T15:43:59.922Z","dependency_job_id":null,"html_url":"https://github.com/ucphhpc/lustrebackup-mgs","commit_stats":null,"previous_names":["ucphhpc/lustrebackup-mgs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ucphhpc/lustrebackup-mgs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucphhpc%2Flustrebackup-mgs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucphhpc%2Flustrebackup-mgs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucphhpc%2Flustrebackup-mgs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucphhpc%2Flustrebackup-mgs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucphhpc","download_url":"https://codeload.github.com/ucphhpc/lustrebackup-mgs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucphhpc%2Flustrebackup-mgs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35057459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-28T08:33:06.994Z","updated_at":"2026-07-02T18:05:13.533Z","avatar_url":"https://github.com/ucphhpc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lustrebackup-mgs\n\nLustre snapshot backup Management Service (MGS) tools.\n\nDeveloped by the [Science HPC Center at UCPH](https://www.science.ku.dk/english/research/). Licensed under the [GNU General Public License v2](LICENSE).\n\n## Overview\n\nThis project provides bash wrapper scripts around Lustre's `lctl snapshot` commands. It solves a core limitation: Lustre cannot handle dynamic changes to `ldev.conf` between snapshot operations. These scripts atomically swap the `ldev.conf` symlink to the correct snapshot-specific configuration before each `lctl` call, then restore it afterwards — all protected by `flock` to prevent race conditions.\n\n## Requirements\n\n- Lustre filesystem with `lctl` available\n- An existing `/etc/ldev.conf`\n- `bash`, `flock`, standard Unix utilities\n- `logger` (for the SSH command validator)\n\n## Installation\n\nCopy files to their respective system locations:\n\n```bash\ncp lib/lustre_snapshot_ldev_init.sh /usr/local/lib/\ncp sbin/lctl_snapshot_*.sh          /usr/local/sbin/\ncp sbin/lctl_ssh_command_validator.sh /usr/local/sbin/\n```\n\nOn first use, `ldev_conf_init` will migrate `/etc/ldev.conf` into `/etc/ldev/ldev.conf` and replace the original with a symlink. Snapshot-specific configs are stored as `/etc/ldev/\u003cfsname\u003e/\u003csnapshot_name\u003e.ldev.conf`.\n\n## Usage\n\n### Create a snapshot\n\n```bash\nlctl_snapshot_create.sh -F \u003cfsname\u003e -n \u003csnapshot_name\u003e [-c \u003ccomment\u003e]\n```\n\nCreates the snapshot and saves a copy of the current `ldev.conf` for future mount/umount/destroy operations.\n\n### List snapshots\n\n```bash\nlctl_snapshot_list.sh -F \u003cfsname\u003e [-n \u003csnapshot_name\u003e]\n```\n\n### Mount a snapshot\n\n```bash\nlctl_snapshot_mount.sh -F \u003cfsname\u003e -n \u003csnapshot_name\u003e [-l \u003cldev_conf_path\u003e]\n```\n\nThe `-l` option overrides the default snapshot ldev conf path (useful for snapshots created before this tooling was in place).\n\n### Unmount a snapshot\n\n```bash\nlctl_snapshot_umount.sh -F \u003cfsname\u003e -n \u003csnapshot_name\u003e [-l \u003cldev_conf_path\u003e]\n```\n\n### Destroy a snapshot\n\n```bash\nlctl_snapshot_destroy.sh -F \u003cfsname\u003e -n \u003csnapshot_name\u003e [-f]\n```\n\nThe `-f` flag forces destruction. Also removes the snapshot's saved `ldev.conf`.\n\n## SSH Command Validator\n\n`lctl_ssh_command_validator.sh` restricts remote SSH access to only the allowed snapshot commands. Set it as a forced command in `authorized_keys`:\n\n```\ncommand=\"/usr/local/sbin/lctl_ssh_command_validator.sh\" ssh-rsa AAAA... user@host\n```\n\nAllowed commands:\n- `/etc/init.d/lustre status MGS`\n- `lctl_snapshot_create.sh` (with any arguments)\n- `lctl_snapshot_destroy.sh` (with any arguments)\n- `lctl_snapshot_list.sh` (with any arguments)\n- `lctl_snapshot_mount.sh` (with any arguments)\n- `lctl_snapshot_umount.sh` (with any arguments)\n\nDenied commands are logged to syslog at `auth.error` via `logger`.\n\n## Configuration paths\n\n| Path | Description |\n|------|-------------|\n| `/etc/ldev.conf` | Symlink managed by these scripts; points to live or snapshot config |\n| `/etc/ldev/ldev.conf` | The live (active filesystem) ldev configuration |\n| `/etc/ldev/\u003cfsname\u003e/\u003csnapshot\u003e.ldev.conf` | Per-snapshot ldev configuration |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucphhpc%2Flustrebackup-mgs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucphhpc%2Flustrebackup-mgs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucphhpc%2Flustrebackup-mgs/lists"}