Archive all sar data on logs server 94/56294/2
authorAnil Belur <abelur@linuxfoundation.org>
Sat, 29 Apr 2017 07:35:51 +0000 (17:35 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 8 May 2017 23:19:53 +0000 (09:19 +1000)
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>
jjb/autorelease/autorelease-macros.yaml

index 67652eab39080ec48a5ecad38272d00881685931..86346cec0d04ffce59367c7c5bf569f811503d64 100644 (file)
                 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