From 6186e434f0b223c94bbc4a8158986907bba656bb Mon Sep 17 00:00:00 2001 From: Michael Uray Date: Sun, 19 Jul 2026 06:04:04 +0000 Subject: [PATCH] [fix] Remove backup file list temp files after backup The cleanup at the end of backup_configuration() used a glob inside double quotes -- rm "${BACKUP_FILE_LIST}*" -- so the shell did not expand the "*" and rm tried to delete a single file literally named "backup_file_list.conf*", which never exists. This failed on every configuration update ("rm: can't remove '.../backup_file_list.conf*'") and left backup_file_list.conf and backup_file_list.conf.tmp behind in the working directory (tmpfs on devices). Delete the two files that are actually created, with -f so a missing file is not an error. Signed-off-by: Michael Uray --- openwisp-config/files/openwisp.agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openwisp-config/files/openwisp.agent b/openwisp-config/files/openwisp.agent index 01a4ab9d..015002bf 100755 --- a/openwisp-config/files/openwisp.agent +++ b/openwisp-config/files/openwisp.agent @@ -857,7 +857,7 @@ backup_configuration() { sort -u "${BACKUP_FILE_LIST}.tmp" >$BACKUP_FILE_LIST # backup only those files tar -zcf $CONFIGURATION_BACKUP -T $BACKUP_FILE_LIST - rm "${BACKUP_FILE_LIST}*" + rm -f "${BACKUP_FILE_LIST}.tmp" "$BACKUP_FILE_LIST" } restore_backup() {