feat(shell-sync): add log()
This commit is contained in:
1 parent
0243d55f18
commit
2458ceeab7
1 file changed
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
# IMAP Sync Manager - multi-account OAuth2 and password authentication.
|
||||
|
||||
TOKEN_DIR="${TOKEN_DIR:-/tokens}"
|
||||
LOG_DIR="${LOG_DIR:-/var/log/imapsync}"
|
||||
PID_DIR="${PID_DIR:-/tmp/imapsync}"
|
||||
HEARTBEAT_FILE="${LOG_DIR}/.heartbeat"
|
||||
NUM_ACCOUNTS="${NUM_ACCOUNTS:-1}"
|
||||
SYNC_INTERVAL="${SYNC_INTERVAL:-21600}" # six hours
|
||||
SYNC_CRON="${SYNC_CRON:-}"
|
||||
ONCE="${ONCE:-false}"
|
||||
|
||||
# Notifications are disabled unless NOTIFY_MODE is explicitly set.
|
||||
# Valid modes: none, batch_success, account_success, failure.
|
||||
NOTIFY_MODE="${NOTIFY_MODE:-none}"
|
||||
SMTP_HOST="${SMTP_HOST:-}"
|
||||
SMTP_PORT="${SMTP_PORT:-587}"
|
||||
SMTP_USER="${SMTP_USER:-}"
|
||||
SMTP_PASS="${SMTP_PASS:-}"
|
||||
SMTP_FROM="${SMTP_FROM:-}"
|
||||
SMTP_TO="${SMTP_TO:-}"
|
||||
SMTP_TLS="${SMTP_TLS:-starttls}"
|
||||
NOTIFICATION_FAILURE_FILE="${LOG_DIR}/.notification_failed"
|
||||
NOTIFICATION_LOG="${LOG_DIR}/notification.log"
|
||||
|
||||
mkdir -p "$LOG_DIR" "$PID_DIR" "$TOKEN_DIR"
|
||||
|
||||
log() {
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user