# 2.1.2 - Added EMAIL_TO and EMAIL_FROM variables for reports.
# 2.1.3 - Added DOCKERUSER variable for account to use for launching contaners
# 2.1.4 - Restic snapshot details (ID, parent, file/dir counts, data added,
# total size, duration) are now written to the logs.
# restic backup now runs with --json; snapshot size is read from the
# backup summary instead of parsing 'restic snapshots' table output,
# so it always refers to this run's snapshot.
# Removed dependency on bc (awk used for arithmetic).
# Added total new data uploaded to end of log.
- Added email delivery of current execution log.
- Added success/failure/interruption notifications and run-specific logs.
- Added automatic cleanup of staging directories on backup failure or interruption.
- Added cleanup_staging() helper function.
- Added CURRENT_STAGING_DIR tracking.
- Added automatic RUN_LOG cleanup during failure and interruption. Improved housekeeping to prevent orphaned staging data after unexpected termination.
- Modified to save all files to a folder tree for backup rather than creating a single monolithic archive. This will allow restic to properly manage snapshots.
- Changed exception lookup to case-insensitive