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