feat: get last modif with single unix user

This commit is contained in:
bsourisse 2023-08-20 16:54:21 +02:00 committed by Ravinou
parent 7b04e8dc4c
commit 04038b5b0d
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7

View file

@ -5,16 +5,12 @@
# stdout will be an array like : # stdout will be an array like :
# [ # [
# { # {
# "user": "09d8240f", # "repositoryName": "a7035047",
# "lastSave": 1668513608 # "lastSave": 1691341603
# }, # },
# { # {
# "user": "635a6f8b", # "repositoryName": "a7035048",
# "lastSave": 1667910810 # "lastSave": 1691342688
# },
# {
# "user": "83bd4ef1",
# "lastSave": 1667985985
# } # }
# ] # ]
@ -22,6 +18,14 @@
# Exit when any command fails # Exit when any command fails
set -e set -e
stat --format='{"user":"%U","lastSave":%Y}' \ # Load .env if exists
/var/borgwarehouse/*/repos/*/integrity* | if [[ -f .env ]]; then
jq --slurp source .env
fi
# Default value if .env not exists
: "${home:=/home/borgwarehouse}"
stat --format='{"repositoryName":"%n","lastSave":%Y}' \
${home}/repos/*/integrity* |
jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]'