1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Persist stderr log with run.sh

This commit is contained in:
Roman Zeyde 2018-08-01 11:07:30 +03:00
parent 016fc46018
commit 87b4df5747
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -1,13 +1,17 @@
#!/bin/bash
set -eu
trap 'kill $(jobs -p)' EXIT
DELAY=5
LOG=/tmp/electrs.log
tail -v -n0 -F "$LOG" &
T=5
export RUST_BACKTRACE=1
while :
do
cargo fmt
cargo check --release
cargo run --release -- $*
echo "Restarting in $T seconds..."
sleep $T
cargo run --release -- $* 2>> "$LOG"
echo "Restarting in $DELAY seconds..."
sleep $DELAY
done