Skip to content

Instantly share code, notes, and snippets.

View socketpair's full-sized avatar

Коренберг Марк socketpair

View GitHub Profile
mmarkk@mmwork:/mnt/cephfs$ stat tgg
File: tgg
Size: 17 Blocks: 0 IO Block: 65536 directory
Device: 0h/0d Inode: 1099514016396 Links: 15
Access: (0700/drwx------) Uid: ( 1000/ mmarkk) Gid: ( 0/ root)
Access: 2019-02-04 23:06:19.636671000 +0500
Modify: 2019-09-16 18:28:18.295697000 +0500
Change: 2019-09-16 18:28:18.295697000 +0500
Birth: -
mmarkk@mmwork:/mnt/cephfs$ cd .snap
@socketpair
socketpair / xfs_snap.py
Created November 6, 2023 19:14
XFS snapshot
import argparse
import json
import logging
import os
from contextlib import contextmanager
from errno import EINVAL
from fcntl import LOCK_EX, flock, ioctl
from os import O_CLOEXEC, O_DIRECTORY, O_RDONLY, close, open as os_open
from pathlib import Path
from shutil import rmtree