I have some shell script as below,
I want to run this process for only 1 minute.
So I want to check the process time and kill the process if it runs > 1 minute. Can anyone help me please?
var=`ps -eaf | pgrep -f getShippingPriceUK.php | wc -l`
if [ $var -lt "1" ]; then
echo "Prozess läuft nicht"
wget -q --timeout=0 --delete-after http://xxxx/001_yakodo/getShippingPrice12.php > /dev/null 2&>1 &
else
echo "Prozess läuft"
fi
If you have perl installed, you can use this perl script.
Save it as
timeout, store it in one of the directories in$PATH, make it executable, then replace all calls towith