Skip to content

Commit

Permalink
univention-samba4-backup: don't touch backups every day
Browse files Browse the repository at this point in the history
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 f065824 calling "chmod" for every files was added, now we do it only for files with wrong permissions.
  • Loading branch information
SvenRoederer committed Jun 28, 2024
1 parent 2b83620 commit 59b5fa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/univention-samba4/sbin/univention-samba4-backup
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 59b5fa7

Please sign in to comment.