From 59b5fa7811aaa76def607f627697759195174beb Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Fri, 28 Jun 2024 02:45:28 +0200 Subject: [PATCH] univention-samba4-backup: don't touch backups every day The backups get their permissions changed every time the script is running. This changes the ctime of the file and causes inclusion to systembackups (e.g. bareos). This is especially annoying when many backupfiles are kept or the files are large. In f065824d7a9b091dfa8c425da5006123770f760c calling "chmod" for every files was added, now we do it only for files with wrong permissions. --- services/univention-samba4/sbin/univention-samba4-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/univention-samba4/sbin/univention-samba4-backup b/services/univention-samba4/sbin/univention-samba4-backup index fd5ff2545bf..ea358692408 100755 --- a/services/univention-samba4/sbin/univention-samba4-backup +++ b/services/univention-samba4/sbin/univention-samba4-backup @@ -97,5 +97,5 @@ install -o root -g root -m 700 -d "$WHERE" umask 0026 # samba-tool updates private/sam.ldb.d/metadata.tdb samba-tool domain backup offline --targetdir="$WHERE" || die "ERROR: samba-tool domain backup failed" -chmod 600 "$WHERE"/samba-backup-*.bz2 +find "$WHERE" -name samba-backup-*.bz2 -a ! -perm 600 -print0 | xargs -0 chmod 600 clean_old_backups 'samba/samba-backup-.*.bz2' "$DAYS"