[Piuparts-devel] [Git][debian/piuparts][develop] WIP: reduce number of mails per day, from 18 down to 16, see #912591.
Holger Levsen
gitlab at salsa.debian.org
Wed Nov 28 10:37:57 GMT 2018
Holger Levsen pushed to branch develop at Debian / piuparts
Commits:
e63d9372 by Holger Levsen at 2018-11-28T10:37:39Z
WIP: reduce number of mails per day, from 18 down to 16, see #912591.
master-bin/reschedule_oldest_logs: redirect logs to htdocs/logs to spare
us two mails per day.
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- debian/changelog
- master-bin/reschedule_oldest_logs.in
Changes:
=====================================
debian/changelog
=====================================
@@ -3,13 +3,15 @@ piuparts (0.95) UNRELEASED; urgency=medium
[ Holger Levsen ]
* piuparts.py: add /var/lib/debian-security-support/ to self.ignored_files.
(Closes: #749317)
- * WIP: reduce number of mails per day, from 34 down to 18, see #912591.
+ * WIP: reduce number of mails per day, from 34 down to 16, see #912591.
- master-bin/detect_archive_issues: redirect logs to htdocs/logs to spare
us two mails per day.
- master-bin/detect_piuparts_issues: redirect logs to htdocs/logs to spare
us eight mails per day.
- master-bin/detect_network_issues: redirect logs to htdocs/logs to spare
us six mails per day.
+ - master-bin/reschedule_oldest_logs: redirect logs to htdocs/logs to spare
+ us two mails per day.
- lib/write_log.sh: new helper to publish logs in htdocs/logs.
- piuparts-report.py: add navigation link to https://piuparts.d.o/logs/
=====================================
master-bin/reschedule_oldest_logs.in
=====================================
@@ -18,12 +18,15 @@
. @sharedir@/piuparts/lib/read_config.sh
+. @sharedir@/piuparts/lib/write_log.sh
get_config_value MASTER global master-directory
get_config_value SECTIONS global sections
+get_config_value HTDOCS global output-directory
STARTDATE=$(date -u +%s)
OUTPUT=$(mktemp)
+TEMPORARY_OUTPUT=$(mktemp)
#
# reschedule 200 oldest log files, if they are older than 180 days
@@ -187,22 +190,25 @@ rm $QUEUED
FINALDATE=$(date -u +%s)
RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
-echo "Runtime: $RUNTIME"
-echo
-
-if [ "$TOTAL" -gt "0" ]; then
- echo "Rescheduled $TOTAL logs."
-fi
-if [ "$TOTAL_EXPIRED" -gt "0" ]; then
- echo "Deleted $TOTAL_EXPIRED expired logs."
-fi
-if [ "$UNSCHEDULE" -gt "0" ]; then
- echo "Cancelled $UNSCHEDULE outdated rescheduling requests."
-fi
-if [ "$TOTAL_QUEUED" -gt "0" ]; then
- echo "Queued logs: $TOTAL_QUEUED"
-fi
-echo
-
-cat $OUTPUT
+(
+ echo "$(date -u)"
+ echo "Runtime: $RUNTIME"
+ echo
+ if [ "$TOTAL" -gt "0" ]; then
+ echo "Rescheduled $TOTAL logs."
+ fi
+ if [ "$TOTAL_EXPIRED" -gt "0" ]; then
+ echo "Deleted $TOTAL_EXPIRED expired logs."
+ fi
+ if [ "$UNSCHEDULE" -gt "0" ]; then
+ echo "Cancelled $UNSCHEDULE outdated rescheduling requests."
+ fi
+ if [ "$TOTAL_QUEUED" -gt "0" ]; then
+ echo "Queued logs: $TOTAL_QUEUED"
+ fi
+ echo
+ cat $OUTPUT
+ echo
+) > $TEMPORARY_OUTPUT
+publish_logs $TEMPORARY_OUTPUT $HTDOCS reschedule_oldest_logs
rm -f $OUTPUT
View it on GitLab: https://salsa.debian.org/debian/piuparts/commit/e63d9372793c444266bb5e9b4bf7da5a3662bde0
--
View it on GitLab: https://salsa.debian.org/debian/piuparts/commit/e63d9372793c444266bb5e9b4bf7da5a3662bde0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20181128/b22fae96/attachment-0001.html>
More information about the Piuparts-devel
mailing list