From d02b616ea0031c397a57278a727b9b0ca3fb3dc2 Mon Sep 17 00:00:00 2001 From: julien Date: Sun, 19 Jan 2025 18:06:35 +0100 Subject: [PATCH] if sockets-to-exclude file is not empty --- sbin/vol-backup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/vol-backup b/sbin/vol-backup index 4931a5c..b6bc2f7 100755 --- a/sbin/vol-backup +++ b/sbin/vol-backup @@ -27,7 +27,9 @@ if [ -d "volumes" ]; then # List sockets to exclude find . -type s -print > /tmp/sockets-to-exclude - sed -i 's/volumes\///g' /tmp/sockets-to-exclude + if grep -q volumes "/tmp/sockets-to-exclude"; then + sed -i 's/volumes\///g' /tmp/sockets-to-exclude + fi # Compress all volumes excerpt mysql and postgres BACKUP=${PWD##*/}.tar.zst