oracle tns listener kilitlendiğinde yeniden başlatmak için basit bir script

Hani böylesine zorla yapmak istemeyizde mecbur kalınca, niye olmasın :)
lsnrctl stop
komutuyla durmuyorsa.
#!/bin/bash

for ind in `ps -aef | grep tnslsnr | grep -v grep | cut -f4 -d ' '`
do
kill -9 $ind
echo "process $ind"
done
if [ $? -eq 0 ]; then
lsnrctl start
fi
exit

Bookmark and Share
Tags: , , , , ,

Related posts

Database
oracle

Comments (0)

Permalink

Bir dizinde aynı içerikli dosyaları bulmak için bir script

#!/bin/bash
#dupfind.sh
#author: myownshadow
#TODO:
#needs find redirecting without for loop (find invokes subshells)
#need a faster checksum, md5sum can be very slow with big files

for ind in `find $1 -type f -print0 | xargs -0 md5sum |sed s/\ /-/g`
do
echo $ind >> .md5list &2>/dev/null
done
cat .md5list|cut -c1-32| sort| uniq -d >> .duplist
for line in `cat .duplist`
do
cat .md5list | grep $line | cut -c35-
done
rm .md5list
rm .duplist
exit

Kullanım:
$dupfind.sh /media/iPOD

Bookmark and Share
Tags: , , , ,

Related posts

Yazılım

Comments (0)

Permalink

Apache için basit bir log viewer

#!/bin/bash
if [ ! -f /tmp/logcopy ]
then
echo "first run, copying log file"
cp /var/log/apache2/access.log /tmp/logcopy
fi
oldfilehash=`md5sum /tmp/logcopy | cut -d " " -f1`
newfilehash=`md5sum /var/log/apache2/access.log | cut -d " " -f1`
if [ "$oldfilehash" != "$newfilehash" ]; then
diff /var/log/apache2/access.log /tmp/logcopy > /tmp/logdiff
if [ ! $? -eq 0 ]; then
cat /tmp/logdiff | zenity --title "Apache Log Viewer" --text-info --width 1024 --height 800
fi
cp -u /var/log/apache2/access.log /tmp/logcopy
fi
exit

/usr/local/bin altına kaydedip kullanabilirsiniz.

Bookmark and Share
Tags: , , , , , ,

Related posts

Yazılım

Comments (0)

Permalink

Switch to our mobile site