Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
The UUID of the server
Request Body
The root directory for compression operations (all paths are relative to this)
Array of file/directory paths to include in the archive (relative to root)
Response
Returns a JSON object with the created archive information.Information about the created archive file
Example Request
Example Response
Behavior
- Creates a gzip-compressed tar archive (
.tar.gz) - Archive is created in the specified
rootdirectory - Filename format:
archive-YYYY-MM-DD-HHMMSS.tar.gz - Both files and directories can be compressed
- Directories are archived recursively
- Preserves file permissions and timestamps
- Symlinks are followed and their targets are archived
- Path traversal is prevented
The compression operation runs asynchronously. The response is returned immediately with the expected archive information, but the actual compression may take some time for large datasets.
Error Responses
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
Server does not exist or source files not found
500 Internal Server Error
500 Internal Server Error
Failed to create archive (disk full, permission error, etc.)
Use Cases
- Create backups of world files
- Archive old logs
- Package plugins for transfer
- Create downloadable server snapshots
- Prepare files for export
Source Reference
Implementation:router/router_server_files.go (postServerCompressFiles function)