aboutsummaryrefslogtreecommitdiff
path: root/utils/slave-logs/merge-logs.sh
blob: 125cb057b9cd305c2e77cd02737683af3cc2f6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#
# archive-slave-logs script may move not yet complete logs, so
# later new log with the same will be created (usually it has
# just one line though: "Connection terminated"). We copy with
# mv --backup, so original file will be backed up as *~. This
# script both such parts together (again, 2nd part usually
# contains just one line, but to be on safe side and fuly correct).
#
# This script should be run with sudo
#

cd /var/lib/jenkins/slave-logs

for f in 20*~; do
    main=`echo $f | sed -e 's/~//'`
    echo "cat $main >> $f && mv $f $main"
done