The author manages a static blog hosted on a server in Russia, while build scripts and background tasks run on a separate server in Germany. The system updates the main page, RSS feed, and sitemap every 15 minutes using a systemd timer. Over a period of 1.5 months, this automated process successfully completed 3,907 runs.
To prevent conflicts between concurrent processes, the system uses a flock file lock with a 900-second timeout. The build process utilizes rsync with specific filters to synchronize only necessary files. To avoid overwriting manual edits made to the main page on the production server, the script compares MD5 checksums before pushing updates.
The build pipeline includes a wrapper that checks Python scripts for syntax errors using ast.parse before execution. If a script fails, the system attempts to revert to the last known good version stored in a dedicated directory. This mechanism ensures that the site remains functional even if a new build script contains errors.
Security measures were implemented to prevent the accidental exposure of source files and drafts. The rsync configuration excludes various temporary and source file extensions. Additionally, the Nginx configuration on the production server is set to return a 404 error for requests targeting sensitive file types or hidden directories.



