I have been trying to get a shell script to run for hours using cron to no avail. I am trying to have the following bash script run every minute
#!/bin/bash PATH=/usr/local/bin/ices:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ps cax | grep 'ices' > /dev/null if [ $? -eq 0 ]; then echo "Process is running." else /usr/local/bin/ices /etc/ices/playlist.pls fi
It checks if a process is running, and if not reloads it. It works as an executable (permissions are set to 755).
My crontab looks like
# m h dom mon dow command */1 * * * * /etc/ices/checkIces.sh */1 * * * * env > /tmp/env.output
The second line is to check if cron will at least log out the env in the tmp folder. Does anyone see anything wrong with my current implementation?