If the command pgrep exists, try this:
If not, this:
Make sure you use full paths though, or you might run into troubles with restarting.
This script should run fine via cron. Put it into a file and tell cron to run it eg every minute.
Try it manually first: name it test.sh or whatever you want to call it and execute it.
If your bot is running, you should see not output. If it is not, your bot should appear in the processlist afterwards.
Code:
#!/usr/bin/bash
if [[ ! $(pgrep -f "rtgferfd.py") ]]; then
echo "Bot down"
python rtgferfd.py --solid --r --fr --quantity 35 --wait_time 34 &
fi
If not, this:
Code:
#!/usr/bin/bash
if [ "$(ps ax | grep "rtgferfd.py" | grep -vc grep)" -eq "0" ]; then
echo "Bot down"
python rtgferfd.py --solid --r --fr --quantity 35 --wait_time 34 &
fi
Make sure you use full paths though, or you might run into troubles with restarting.
This script should run fine via cron. Put it into a file and tell cron to run it eg every minute.
Try it manually first: name it test.sh or whatever you want to call it and execute it.
If your bot is running, you should see not output. If it is not, your bot should appear in the processlist afterwards.
You`re awesome!
I`ll try to see if it`ll work like this!
Thank you very very much!