From 11c8653d261b60e847bc930355f9d4a2e07e1f64 Mon Sep 17 00:00:00 2001 From: jmqm Date: Tue, 13 Jul 2021 22:13:24 -0500 Subject: [PATCH] More echoes (#12) - `echo` when a script _(`backup`, `delete`)_ is added to cron jobs. --- delete.sh | 2 +- entrypoint.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/delete.sh b/delete.sh index 7975567..16847c7 100644 --- a/delete.sh +++ b/delete.sh @@ -7,4 +7,4 @@ cd /backups find . -iname "*.tar.xz" -type f -mtime +$DELETE_AFTER -exec rm -f {} \; # Echo that script ran. -echo "Deleted files older than $DELETE_AFTER days." +echo "[INFO] Deleted files older than $DELETE_AFTER days." diff --git a/entrypoint.sh b/entrypoint.sh index c815670..480591b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,13 +13,15 @@ fi # Create cron jobs. if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; then - # Add backup script to cron job list. + # Add backup script to cron jobs. echo "$CRON_TIME $BACKUP_CMD >> $LOGS_FILE 2>&1" | crontab - + echo "[INFO] Added delete script to cron jobs." # Check if $DELETE_AFTER is not null and is greater than 0. - # If so, add it to the cron job list. + # If so, add it to cron jobs. if [ -n "$DELETE_AFTER" ] && [[ "$DELETE_AFTER" -gt 0 ]]; then echo "$CRON_TIME $DELETE_CMD >> $LOGS_FILE 2>&1" | crontab - + echo "[INFO] Added delete script to cron jobs." fi fi