Add log rotation with datetime-named files in logs/ directory
This commit is contained in:
+8
-28
@@ -11,7 +11,7 @@
|
||||
"ghcr.io/pelican-eggs/steamcmd:debian": "ghcr.io/pelican-eggs/steamcmd:debian"
|
||||
},
|
||||
"file_denylist": [],
|
||||
"startup": "./CoreKeeperServer -batchmode -nographics -logfile /dev/stdout -world {{WORLD_INDEX}} -worldname \"{{WORLD_NAME}}\" -worldseed {{WORLD_SEED}} -maxplayers {{MAX_PLAYERS}} -worldmode {{WORLD_MODE}} -port {{SERVER_PORT}} $([[ \"{{GAME_ID}}\" != \"\" ]] && echo -n \" -gameid {{GAME_ID}}\") $([[ \"{{SERVER_PASSWORD}}\" != \"\" ]] && echo -n \" -password {{SERVER_PASSWORD}}\")",
|
||||
"startup": "mkdir -p ./logs; LOGFILE=\"./logs/server_$(date +%Y-%m-%d_%H-%M-%S).log\"; find ./logs -name \"server_*.log\" -type f | sort -r | tail -n +$((${LOG_ROTATION} + 1)) | xargs -r rm; ./CoreKeeperServer -batchmode -nographics -logfile \"$LOGFILE\" -world {{WORLD_INDEX}} -worldname \"{{WORLD_NAME}}\" -worldseed {{WORLD_SEED}} -maxplayers {{MAX_PLAYERS}} -worldmode {{WORLD_MODE}} -port {{SERVER_PORT}} $([[ \"{{GAME_ID}}\" != \"\" ]] && echo -n \" -gameid {{GAME_ID}}\") $([[ \"{{SERVER_PASSWORD}}\" != \"\" ]] && echo -n \" -password {{SERVER_PASSWORD}}\") & tail -f \"$LOGFILE\"",
|
||||
"config": {
|
||||
"files": "{}",
|
||||
"startup": "{\"done\": \"Started session\"}",
|
||||
@@ -117,33 +117,13 @@
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Display Width",
|
||||
"description": "Virtual display width for xvfb (internal).",
|
||||
"env_variable": "DISPLAY_WIDTH",
|
||||
"default_value": "1",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|integer",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Display Height",
|
||||
"description": "Virtual display height for xvfb (internal).",
|
||||
"env_variable": "DISPLAY_HEIGHT",
|
||||
"default_value": "1",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|integer",
|
||||
"field_type": "text"
|
||||
},
|
||||
{
|
||||
"name": "Display Depth",
|
||||
"description": "Virtual display color depth for xvfb (internal).",
|
||||
"env_variable": "DISPLAY_DEPTH",
|
||||
"default_value": "24",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|integer",
|
||||
"name": "Log Rotation",
|
||||
"description": "Number of old log files to keep. Oldest logs are deleted on each server start.",
|
||||
"env_variable": "LOG_ROTATION",
|
||||
"default_value": "10",
|
||||
"user_viewable": true,
|
||||
"user_editable": true,
|
||||
"rules": "required|integer|min:1|max:100",
|
||||
"field_type": "text"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user