mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-13 20:04:45 +08:00
🎈 Sync 2026-09-09 01:06:03
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
. /usr/libexec/haproxy-manager/common.sh
|
||||
|
||||
BASE="$(backup_dir)"
|
||||
[ ! -d "$BASE" ] || BASE="$(resolve_storage_dir "$BASE")" || exit 1
|
||||
LAST=""
|
||||
[ ! -r "$BASE/LAST" ] || LAST="$(basename "$(cat "$BASE/LAST")")"
|
||||
|
||||
count=0
|
||||
for dir in $(find "$BASE" -maxdepth 1 -type d -name '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]' 2>/dev/null | sort -r); do
|
||||
[ -d "$dir" ] || continue
|
||||
id="$(basename "$dir")"
|
||||
current=0
|
||||
[ "$id" != "$LAST" ] || current=1
|
||||
files=0
|
||||
for file in firewall uhttpd haproxy_manager haproxy.cfg; do
|
||||
[ ! -f "$dir/$file" ] || files=$((files + 1))
|
||||
done
|
||||
printf 'backup\t%s\t%s\t%s\n' "$id" "$current" "$files"
|
||||
count=$((count + 1))
|
||||
[ "$count" -lt "$BACKUP_LIMIT" ] || break
|
||||
done
|
||||
Reference in New Issue
Block a user