Its possible multiple sar data files could exist when
the autorelease job is completed, therefore copy and convert
all sar files into $WORKSPACE/archives and not just the recent
file.
Change-Id: I4490b8c28b3cd96c0d9566a951acddcf825310e6
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
mkdir -p archives/
cp /var/log/sa/* $_
# convert sar data to ascii format
- sar -A -f /var/log/sa/sa$(date +%d) > archives/sar$(date +%d)
+ while IFS="" read -r s
+ do
+ [ -f "$s" ] && sar -A -f "$s" > archives/sar/sar${s//[!0-9]/}
+ done < <(find /var/log/{sa,sysstat} -name "sa[0-9]*")
script-only-if-succeeded: false
script-only-if-failed: false