We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
btrbk list
I have a use-case where I need to determine the latest btrbk snapshot for some subvol.
I had to resort to parsing the raw format using a regex:
btrbk list --format=raw | rg "^.* snapshot_subvolume='(/.*?/snapshotnamehere\..*?)' .*$" --replace '$1' | tail -n 1
This would have been much simpler (not to mention more robust) if there was an option to output a standardised machine-readable format such as JSON.
The text was updated successfully, but these errors were encountered:
this is what I do. Does not make use of raw but btrbk custom format. Yes json would be nice.
btrbk_latest() { local file=$(btrbk_conf $1) [[ ! $file ]] && echo unable to find conf file for ${1:-btrbk.conf} && return 1 shift local latest=$(sudo btrbk -c $file list latest --format col:h:snapshot_subvolume | xargs -I % sh -c 'basename %' | sed '$!N; /^\(.*\)\n\1$/!P; D') echo $latest }
Sorry, something went wrong.
No branches or pull requests
I have a use-case where I need to determine the latest btrbk snapshot for some subvol.
I had to resort to parsing the raw format using a regex:
This would have been much simpler (not to mention more robust) if there was an option to output a standardised machine-readable format such as JSON.
The text was updated successfully, but these errors were encountered: