mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-04 14:05:11 +02:00
17 lines
400 B
Plaintext
17 lines
400 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
set -e
|
||
|
|
||
|
LOG_FILE=./jobs.log
|
||
|
touch ${LOG_FILE}
|
||
|
UUID="xxxxxxxxxxxxxxxxx"
|
||
|
|
||
|
exec > >(read message; echo "$(date) ${UUID} [info] $message" | tee -a ${LOG_FILE} )
|
||
|
exec 2> >(read message; echo "$(date) ${UUID} [error] $message" | tee -a ${LOG_FILE} >&2)
|
||
|
|
||
|
echo "Start"
|
||
|
|
||
|
docker run alpine sh -c 'while :; do echo "ping"; sleep 1; done'
|
||
|
# [error] write /dev/stdout: broken pipe
|
||
|
|
||
|
echo "End"
|