fix: redirect logs to stderr and reduce size thresholds in backup/verify scripts
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
This commit is contained in:
@@ -77,10 +77,10 @@ YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
LOG_PREFIX="[Backup ${TIMESTAMP}]"
|
||||
|
||||
log() { echo "${LOG_PREFIX} $1"; }
|
||||
log_success() { echo -e "${LOG_PREFIX} ${GREEN}✅ $1${NC}"; }
|
||||
log_error() { echo -e "${LOG_PREFIX} ${RED}❌ ERROR: $1${NC}"; }
|
||||
log_warning() { echo -e "${LOG_PREFIX} ${YELLOW}⚠️ $1${NC}"; }
|
||||
log() { echo "${LOG_PREFIX} $1" >&2; }
|
||||
log_success() { echo -e "${LOG_PREFIX} ${GREEN}✅ $1${NC}" >&2; }
|
||||
log_error() { echo -e "${LOG_PREFIX} ${RED}❌ ERROR: $1${NC}" >&2; }
|
||||
log_warning() { echo -e "${LOG_PREFIX} ${YELLOW}⚠️ $1${NC}" >&2; }
|
||||
|
||||
# ==============================================================================
|
||||
# TELEGRAM
|
||||
@@ -161,7 +161,7 @@ Date : $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
# Vérification taille
|
||||
local size_bytes
|
||||
size_bytes=$(stat -c %s "${dump_file}" 2>/dev/null || stat -f %z "${dump_file}")
|
||||
local min_bytes=$((1024 * 1024)) # 1MB minimum
|
||||
local min_bytes=1024 # 1KB minimum (safe for new/small databases)
|
||||
|
||||
if [ "${size_bytes}" -lt "${min_bytes}" ]; then
|
||||
log_error "Dump trop petit ($(numfmt --to=iec ${size_bytes})) — base de données vide ?"
|
||||
|
||||
Reference in New Issue
Block a user