folder2archive/append

9 lines
281 B
Plaintext
Raw Permalink Normal View History

2023-04-18 19:59:13 +02:00
# 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 {} \;