Skip to content

Commit 30b0ef4

Browse files
committed
Update cron.sh
1 parent f6a2c88 commit 30b0ef4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cron.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# Script to run in cron for production, once puppet has set everything up
4-
# Only produces output if the `Result:` line does not contain `PASS`
4+
# Only produces output if the last `Result:` line does not contain `PASS`
55

6-
~/bin/metacpan-monitoring-carton exec ~/carton/metacpan-monitoring/bin/swat | tail -1 | grep -v 'Result: PASS'
6+
export SWAT_FILE="/tmp/last_swat_run"
7+
8+
# Run and save output to tmp
9+
~/bin/metacpan-monitoring-carton exec ~/carton/metacpan-monitoring/bin/swat > $SWAT_FILE
10+
11+
# Look at the last line, if it does NOT match 'Result: PASS' then cat
12+
# the whole file for us to debug
13+
tail -1 $SWAT_FILE | grep -v 'Result: PASS' && cat $SWAT_FILE

0 commit comments

Comments
 (0)