From d776db6ea7699b2840e7a877a7194c2e45f371f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20M=C3=B6lle?= Date: Tue, 18 Apr 2023 19:59:13 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9Eappend=E2=80=9C=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- append | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 append diff --git a/append b/append new file mode 100644 index 0000000..01bfb1e --- /dev/null +++ b/append @@ -0,0 +1,8 @@ +# Create a timestamp in the format YYYY-MM-DD +DATE=$(date +%Y-%m-%d) + +# Create the zipped archive and append the date +zip -r "${ARCHIVE_DIR}/folder_${DATE}.zip" "${SOURCE_DIR}" + +# Delete files older than 14 days +find "${ARCHIVE_DIR}" -name "folder_*.zip" -mtime +13 -exec rm {} \;