File size: 931 Bytes
e4fbb50 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#!/bin/bash
current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "Starting n8n at $current_time"
# 设置 N8N 环境变量
export N8N_ENCRYPTION_KEY="n8n8n8n"
# 允许使用所有内建模块
export NODE_FUNCTION_ALLOW_BUILTIN=*
# 允许使用外部 npm 模块
export NODE_FUNCTION_ALLOW_EXTERNAL=*
# Activate automatic data pruning
export EXECUTIONS_DATA_PRUNE=true
# Number of hours after execution that n8n deletes data
export EXECUTIONS_DATA_MAX_AGE=36
# Number of executions to store
export EXECUTIONS_DATA_PRUNE_MAX_COUNT=1000
# Save executions ending in errors
export EXECUTIONS_DATA_SAVE_ON_ERROR=all
# Save successful executions
export EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
# Don't save node progress for each execution
export EXECUTIONS_DATA_SAVE_ON_PROGRESS=false
# Don't save manually launched executions
export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
# 使用绝对路径调用 n8n,添加日志输出
exec n8n start
|