Utilidades


On vim find each occurrence of 'foo' (in all lines), and replace it with 'bar'.

:%s/foo/bar/g
---------------------------------------------------------------------------------------------------------
docker run -d -v /home/analytics.reprocess:/home/elasticsearch/ --name split48.py reprocess.elasctic.py
----------------------------------------------------------------------------------------------------
split -l 2000000 -d --additional-suffix=".log" --verbose /home/td-agent.log /home/newSplit/split
----------------------------------------------------------------------------------------------------
rename 's/emisoras.FAILED_3_/emisoras./' *.gz
rename 's/emisoras.OK_/emisoras./' *.gz

----------------------------------------------------------------------------------------------------
tar -czvf /tmp/encoder_system20180212.tar.gz --exclude="encoder_system/tmp"  --exclude="encoder_system/input" --exclude="encoder_system/output" --exclude="encoder_system/.git" encoder_system/
----------------------------------------------------------------------------------------------------

folders=(  
        /var/www/html/logs/07/03
        /var/www/html/logs/07/04     
)


for f in "${folders[@]}"
do     
    echo "############ folder $f "
    subfolders=$(ls  $f)
    for sub in $subfolders
    do
        echo "############ subfolder $f/$sub"
        files=$(ls  $f/$sub)
        for file in $files
        do   

            _file=$f/$sub/$file
            gzip -d < "$_file"  > $_file.tmp

            fileEmisora=/var/www/html/logs/emisoras/emisoras."$file".EMISORAS

            awk '/[a-zA-Z]+live\/[a-zA-Z]+.stream/{print}' $_file.tmp >> $fileEmisora

            rm -rf $_file.tmp

            if [[ ! -s $fileEmisora ]] ; then
                rm -rf $fileEmisora
            else
                gzip $fileEmisora                 
            fi ;
                        
        done 
    done
done




Comentarios

Entradas populares de este blog