creates the condensed log of just the scan state and updates from watchtower that kuma-watchtower-ran uses to see if last night it ran
This commit is contained in:
16
record-docker-updates
Executable file
16
record-docker-updates
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script simply greps for the containers updated and overall state from watchtower
|
||||
# but just for today and stores this into $DOCKER_DIR/log/...
|
||||
# (use today, as watchtower runs at 3am, this cron after 6am)
|
||||
|
||||
export DOCKER_DIR=/srv/docker
|
||||
export LOG=$DOCKER_DIR/log/update-docker.log
|
||||
export CONF=$DOCKER_DIR/config/docker-compose.yml
|
||||
|
||||
TODAY=$(/bin/date '+%Y-%m-%d')
|
||||
|
||||
/bin/docker compose -f $CONF logs watchtower 2>&1 | /bin/grep "$TODAY.*Session done" | /bin/awk '{for(i=3;i<=NF;++i)printf "%s ", $i; print ""}' >> $LOG
|
||||
/bin/docker compose -f $CONF logs watchtower 2>&1 | /bin/grep "$TODAY.*Found new" | /bin/awk '{for(i=3;i<=NF;++i)printf "%s ", $i; print ""}' >> $LOG
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user