Fix issue caused by process substitution on sh
[releng/builder.git] / jjb / autorelease / include-raw-autorelease-collect-sar.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 mkdir -p archives/
13 cp /var/log/sa/* $_
14 # convert sar data to ascii format
15 while IFS="" read -r s
16 do
17     [ -f "$s" ] && sar -A -f "$s" > archives/sar/sar${s//[!0-9]/}
18 done < <(find /var/log/{sa,sysstat} -name "sa[0-9]*")