From a2e50c1679b04ebbe6a673b5677dbcf0949525ba Mon Sep 17 00:00:00 2001 From: mergwyn Date: Tue, 29 Oct 2024 14:25:28 +0000 Subject: [PATCH] Only match hostname at start of line --- site-modules/profile/files/kopia-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-modules/profile/files/kopia-backup b/site-modules/profile/files/kopia-backup index e5879acf..331c09fd 100755 --- a/site-modules/profile/files/kopia-backup +++ b/site-modules/profile/files/kopia-backup @@ -32,7 +32,7 @@ for repo in ${REPOS} ; do if [[ $date -lt $comp ]] ; then log_error "Backup for ${host}:${snap} on ${snapdate} is more than ${too_old} (${repo})" fi - done< <( kopia snapshot list --max-results=1 --json | jq -r '.[] | "\(.endTime) \(.source.host) \(.source.path)"' | grep $(hostname) ) + done< <( kopia snapshot list --max-results=1 --json | jq -r '.[] | "\(.endTime) \(.source.host) \(.source.path)"' | grep "^$(hostname) " ) log_debug "Maintenance for repo ${repo} is ${MAINTENANCE}" if [[ ${MAINTENANCE} = true ]] ; then