工作log记录
- 提取全英文部分
#!/usr/bin/env bash
#Extracting by singer
stage=$1
date=1008
add=/voicedata2/dataresource/$date
music=/home/silin/chezai_online_eng/music20211008
albums=$music/albums
songs=$music/songs
stage=$1
if [ $stage == '1' ];then
filelist=$(find ${add}/. -type f)
sort $add/singeradd.list | while read line
do
echo 'AT SINGER :'$line
for file in $filelist;do
grep ^$line $file | awk -F'\t' '{print $2}' | grep -E '^[a-zA-Z]*$' | tr [A-Z] [a-z] > $albums/$line
grep ^$line $file | awk -F'\t' '{print $3}' | grep -E '^[a-zA-Z]*$' | tr [A-Z] [a-z] > $songs/$line
done
echo 'FINISHED SINGER :'$line
done
#for n in $(find $songs/. -type f) ; do mv $n `echo $n | tr '[:lower:]' '[:upper:]'`; done
elif [ $stage == '2' ];then
>$music/singer_s_song.list
>$music/singer_s_album.list
>$music/song_by_singer.list
>$music/album_by_singer.list
cat $music/singeradd.list | while read name
do
if [ -s $songs/$name ];then
cat $songs/$name | while read line
do
echo $name\'s $line | tr [A-Z] [a-z] >> $music/singer_s_song.list
for mid in by of;do
echo $line $mid $name | tr [A-Z] [a-z] >> $music/song_by_singer.list
done
done
fi
if [ -s $albums/$name ];then
cat $albums/$name | while read line
do
echo $name\'s $line | tr [A-Z] [a-z] >> $music/singer_s_album.list
for mid in by of;do
echo $line $mid $name | tr [A-Z] [a-z] >> $music/album_by_singer.list
done
done
fi
done
elif [ $stage == '3' ];then
cat $music/singeradd.list | tr [A-Z] [a-z] | sed "s/$/\'s/g" > $music/lowercasesinger.list
fi
- 杀工作脚本
#!/usr/bin/env bash
jobs=$1
if [ $# != 1 ];then
echo "Usage: kill_jobs.sh [jobs name] "
exit -1
fi
for id in $(ps -ef | grep $jobs | awk '{print $2}');do
kill -9 $id
echo Killed $id
done