root / snf-tools / conf / snf-burnin-run.sh @ ee45eb81
History | View | Annotate | Download (534 Bytes)
1 |
#! /bin/bash |
---|---|
2 |
|
3 |
#Example script for an snf-burnin cronjob. |
4 |
#Starts an a snf-burnin test, deletes stale instances and archives old logs. |
5 |
#It aborts if snf-burnin runs for longer than expected. |
6 |
|
7 |
#Usage: ./snf-burnin-run.sh TOKEN IMAGE-ID LOG-FOLDER |
8 |
|
9 |
timeout --foreground 25m snf-burnin --token="$1" --image-id="$2" --action-timeout 120 --log-folder "$3" |
10 |
snf-burnin --token="$1" --delete-stale |
11 |
|
12 |
#Delete old folders |
13 |
old=$(date -d "1 week ago" +%Y%m%d%H%M%S) |
14 |
for dir in ${3}/* ; do |
15 |
d=`basename $dir` |
16 |
(($d<$old)) && rm -r "$dir" |
17 |
done |