Bring script headers onto the template and close safeguard gaps
Headers claimed protections the code never had, and several destructive paths had no guard against a collapsed config value.
This commit is contained in:
@@ -17,6 +17,24 @@
|
||||
# last 7 days activity timeline, any transfers or days exceeding BANDWIDTH_WARN_GB.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL MODEL
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Log mode (--log-transfer), called by rsync.sh after every sync:
|
||||
# 1. Append one line: YYYY-MM-DD|HH:MM|profile|duration|status|bytes
|
||||
# 2. Trim entries older than BANDWIDTH_LOG_RETENTION days
|
||||
# One bounded write per rsync run — never grows without limit, never rewrites history.
|
||||
#
|
||||
# Report mode (default), scheduled weekly:
|
||||
# 1. Read the accumulated log
|
||||
# 2. Aggregate per profile — run count, total bytes, average duration, failures
|
||||
# 3. Build a 7-day activity timeline
|
||||
# 4. Flag any single transfer or any single day exceeding BANDWIDTH_WARN_GB
|
||||
#
|
||||
# The two modes never run together: logging is a side effect of rsync, reporting is a
|
||||
# scheduled read. Report mode never writes to the log.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# DESIGN PRINCIPLES
|
||||
# ==============================================================================================
|
||||
#
|
||||
@@ -46,9 +64,6 @@
|
||||
# Log Directory Guard
|
||||
# Creates the log directory if it doesn't exist. Exits cleanly if unwritable.
|
||||
#
|
||||
# Notification Validated
|
||||
# platform_require_cmd confirms the notify script is present before use.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================================
|
||||
|
||||
Reference in New Issue
Block a user