A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
50 lines
1.2 KiB
Bash
50 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
resticCheckLocation()
|
|
{
|
|
local idx="$1"
|
|
local read_data="$2"
|
|
|
|
resticEnvExport "$idx" || return 1
|
|
|
|
local args=(check)
|
|
if [[ "$read_data" == "full" ]]; then
|
|
args+=(--read-data)
|
|
elif [[ -n "$read_data" ]]; then
|
|
args+=(--read-data-subset "${read_data}%")
|
|
fi
|
|
|
|
isNotice "Checking $(resticLocationName "$idx")${read_data:+ (sample: ${read_data}%)}"
|
|
sudo -E -u "$docker_install_user" restic "${args[@]}"
|
|
local rc=$?
|
|
resticEnvUnset
|
|
if [[ $rc -eq 0 ]]; then
|
|
isSuccessful "$(resticLocationName "$idx") integrity OK"
|
|
else
|
|
isError "$(resticLocationName "$idx") integrity FAILED"
|
|
fi
|
|
return $rc
|
|
}
|
|
|
|
resticCheckAllLocations()
|
|
{
|
|
local read_data="$1"
|
|
local idx
|
|
local failed=0
|
|
while IFS= read -r idx; do
|
|
[[ -z "$idx" ]] && continue
|
|
resticCheckLocation "$idx" "$read_data" || failed=$((failed + 1))
|
|
done < <(resticEnabledLocations)
|
|
return $failed
|
|
}
|
|
|
|
resticLocationStats()
|
|
{
|
|
local idx="$1"
|
|
resticEnvExport "$idx" || return 1
|
|
sudo -E -u "$docker_install_user" restic stats --json --no-lock 2>/dev/null
|
|
local rc=$?
|
|
resticEnvUnset
|
|
return $rc
|
|
}
|