mastodon-image-uploader-bot/run_with_log.sh

10 lines
299 B
Bash
Raw Normal View History

2023-07-14 09:03:28 +00:00
#!/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