This Bash script is designed to manage and rotate Nginx log files. It ensures that logs are periodically backed up, cleared, and maintained efficiently by keeping only the latest backups.
$ git clone git@git.elosys.net:sys/bin.git
sudo chmod +x nginx_rotation.sh
sudo cronjob -e
40 1 */3 * * /home/admin/bin/gitlab_log_rotation.sh
This script automates the log rotation process for Nginx logs by ensuring efficient backup and cleanup. By maintaining only the last 7 backups, it helps manage disk space while ensuring log history is available when needed.
— Nadir Habib 2025/02/28 20:57