2017-06-21 13:14:00 -06:00

19 lines
462 B
Bash
Executable File

#!/usr/bin/env bash
set -e
LOG_FILE=./jobs.log
touch ${LOG_FILE}
UUID="xxxxxxxxxxxxxxxxx"
exec > >(read message; echo "${UUID} $(date) [info] $message" | tee -a ${LOG_FILE} )
exec 2> >(read message; echo "${UUID} $(date) [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
# --log-driver syslog <- errors
# --log-driver none <- errors
echo "End"