diff --git a/scripts/imports/manage_backup_schedule.sh b/scripts/imports/manage_backup_schedule.sh index bf687d4..5e6319f 100644 --- a/scripts/imports/manage_backup_schedule.sh +++ b/scripts/imports/manage_backup_schedule.sh @@ -65,7 +65,7 @@ check_system_requirements() { if [ "$available_space" -lt "$required_space" ]; then log_action "ERROR: Insufficient disk space" return 1 - } + fi return 0 } @@ -108,9 +108,7 @@ add_update_cron_job() { fi # Prepare cron command with environment variables and error handling - local CMD="RESTIC_PASSWORD=\"$restic_password\" \ -LOG_FILE=\"${BACKUP_LOG_PREFIX}\$(date +\\%Y-\\%m-\\%d_\\%H-\\%M-\\%S).log\" \ -$BACKUP_SCRIPT > \"\$LOG_FILE\" 2>&1 || echo \"\$(date) Backup failed\" >> \"$ACTION_LOG_FILE\"" + local CMD="RESTIC_PASSWORD='$restic_password' LOG_FILE='${BACKUP_LOG_PREFIX}\$(date +\%Y-\%m-\%d_\%H-\%M-\%S).log' $BACKUP_SCRIPT > \"\$LOG_FILE\" 2>&1 || echo \"\$(date) Backup failed\" >> \"$ACTION_LOG_FILE\"" # Safely update crontab crontab -l 2>/dev/null | grep -v "$BACKUP_SCRIPT" > "$temp_crontab" || true @@ -193,4 +191,4 @@ main() { } # Execute main function with all arguments -main "$@" \ No newline at end of file +main "$@"