mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-05-22 15:36:41 +02:00
feat: get last modif with single unix user
This commit is contained in:
parent
7b04e8dc4c
commit
04038b5b0d
|
@ -5,16 +5,12 @@
|
|||
# stdout will be an array like :
|
||||
# [
|
||||
# {
|
||||
# "user": "09d8240f",
|
||||
# "lastSave": 1668513608
|
||||
# "repositoryName": "a7035047",
|
||||
# "lastSave": 1691341603
|
||||
# },
|
||||
# {
|
||||
# "user": "635a6f8b",
|
||||
# "lastSave": 1667910810
|
||||
# },
|
||||
# {
|
||||
# "user": "83bd4ef1",
|
||||
# "lastSave": 1667985985
|
||||
# "repositoryName": "a7035048",
|
||||
# "lastSave": 1691342688
|
||||
# }
|
||||
# ]
|
||||
|
||||
|
@ -22,6 +18,14 @@
|
|||
# Exit when any command fails
|
||||
set -e
|
||||
|
||||
stat --format='{"user":"%U","lastSave":%Y}' \
|
||||
/var/borgwarehouse/*/repos/*/integrity* |
|
||||
jq --slurp
|
||||
# Load .env if exists
|
||||
if [[ -f .env ]]; then
|
||||
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])]'
|
Loading…
Reference in a new issue