Created
July 12, 2014 07:41
-
-
Save haiy/cd7143155290f9df81a9 to your computer and use it in GitHub Desktop.
收集yarn log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
log=/alidata1/data/hdfs/nodemanager_log | |
rsync -avc root@ZERONE-01:/alidata1/data/hdfs/nodemanager_log/ $log | |
current_dir=`pwd` | |
origin_log_dir=/alidata1/data/hdfs/nodemanager_log | |
cd $origin_log_dir | |
target_dir=`ls -t | head -n 1` | |
cd $origin_log_dir/$target_dir | |
rm stdout stderr | |
echo `pwd` | |
dirlst=`ls` | |
for d in $dirlst; | |
do | |
nm=$(echo $d | cut -d _ -f 5) | |
echo $d, $nm | |
echo "===================================" >> stdout | |
cat $d/stdout >> stdout | |
echo "===================================" >> stderr | |
cat $d/stderr >> stderr | |
done | |
cp stdout stderr $current_dir/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment