From 3588485df39416e407217eb52a239865be0fc455 Mon Sep 17 00:00:00 2001 From: zankia Date: Mon, 19 Feb 2024 00:23:46 +0100 Subject: [PATCH] fix: rm commands --- Makefile | 2 +- autobackup/DEBIAN/control | 2 +- autobackup/usr/bin/autobackup | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9d357f6..b5d7b32 100644 --- a/Makefile +++ b/Makefile @@ -14,4 +14,4 @@ publish: build curl -u zankia:$(GITEA_TOKEN) --upload-file $(PACKAGE_NAME).deb https://git.zankia.fr/api/packages/zankia/debian/pool/gitea/main/upload clean: - rm $(PACKAGE_NAME).deb + rm -f $(PACKAGE_NAME).deb diff --git a/autobackup/DEBIAN/control b/autobackup/DEBIAN/control index b153969..0c8c975 100644 --- a/autobackup/DEBIAN/control +++ b/autobackup/DEBIAN/control @@ -1,5 +1,5 @@ Package: autobackup -Version: 1.1 +Version: 1.2 Architecture: all Maintainer: zankia Description: automatically backup directories on a regular basis diff --git a/autobackup/usr/bin/autobackup b/autobackup/usr/bin/autobackup index 1eaa126..1e13894 100755 --- a/autobackup/usr/bin/autobackup +++ b/autobackup/usr/bin/autobackup @@ -33,7 +33,7 @@ while IFS= read -r SOURCE; do rsync --archive --relative --link-dest="$BACKUP_DIR/previous" "$SOURCE" "$BACKUP_DIR/backup_$DATE" done <"$SOURCE_LIST_FILE" -rm "$BACKUP_DIR/previous" +rm -f "$BACKUP_DIR/previous" ln -s "backup_$DATE" "$BACKUP_DIR/previous" find "$BACKUP_DIR" -maxdepth 1 -type d -mtime "+$RETENTION_DAYS" -exec rm -r {} \;