mastodon-image-uploader-bot/run_with_log.sh

10 lines
299 B
Bash
Executable File

#!/bin/sh
mastodon-image-uploader-bot >./tmp/log.out 2>./tmp/log.err
if [ ! -s ./tmp/log.err ]; then
echo -n "$(date +"[%Y-%M-%d %T]") success: " >> ./bot.log
cat ./tmp/log.out >> ./bot.log
else
echo -n "$(date +"[%Y-%M-%d %T]") errors: " >> ./bot.log
cat ./tmp/log.err >> ./bot.log
fi