You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
#!/bin/bash
|
|
#
|
|
# Copyright (C) 2024 Simon Quigley <tsimonq2@ubuntu.com>
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
# Configuration
|
|
LOG_DIR="/srv/lubuntu-ci/output/logs/britney"
|
|
SCRIPT_PATH="fetch-indexes"
|
|
MAX_LOG_AGE=86400 # 24 hours in seconds
|
|
|
|
# Ensure the log directory exists
|
|
mkdir -p $LOG_DIR
|
|
|
|
# Log rotation: Remove logs older than MAX_LOG_AGE
|
|
find $LOG_DIR -type f -mtime +1 -exec rm -f {} \;
|
|
|
|
# Execute the fetch-indexes script for each release and log output
|
|
for release in plucky oracular noble; do
|
|
export RELEASE="$release"
|
|
|
|
# Log file named by current UTC time (HH-MM-SS)
|
|
LOG_FILE="$LOG_DIR/$RELEASE_$(date -u +"%H-%M-%S").log"
|
|
|
|
echo "$(date -u +"%Y-%m-%d %H:%M:%S") - Running Britney for $RELEASE" >> "$LOG_FILE"
|
|
"$SCRIPT_PATH" >> "$LOG_FILE" 2>&1
|
|
done
|