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
Tags:
bash,
force listener to restart,
Linux,
lsnrctl,
oracle,
tnslsnr
Tags: bash, force listener to restart, Linux, lsnrctl, oracle, tnslsnr
#!/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
Tags:
bash,
checksum,
duplicate file,
md5,
scripting
Tags: bash, checksum, duplicate file, md5, scripting
#!/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.
Tags:
Apache,
apache2,
bash,
changelog,
log viewer,
script,
zenity
Tags: Apache, apache2, bash, changelog, log viewer, script, zenity