Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi Digital Ocean forum!
I have a script running every minute with crontab. The script looks like this:
#!/bin/bash
UP=$(pgrep node | wc -l);
dt=`date '+%d/%m/%Y_%H:%M:%S'`;
if [ "$UP" -lt 1 ];
then
pushserver -c /var/www/config.json
echo"$dt Node is down.";
else
echo "$dt Node is all good.";
fi
So I’m checking if node is running, if it is, it’s all good, if not it starts it. It works when I fire the script by running sh scriptname.sh
So, i’ve put this into my crontab:
* * * * * sh /home/pushCheck.sh& >> /home/pushCheck.log
* * * * * echo ‘Run this command every minute’ >> /home/crontab.log
* * * * * cd /home/ && sh pushCheck.sh>>pushCheck.log
It’s not really working, but the echo to the logfile, is being logged. So crontab should be up and running. I’ve tried the * * * * * sh pushCheck.sh too, but it doesn’t seem to work and I’m out of ideas.
Hope someone can help me out here :-)
58a301358aa344a792e7b70f6a1ed5
Faisol Bello
Serhii Meleshchenko Miratechgroup
24230eeb31a542b58d79c0715000b8
biomechanico
eddiew
RhumSite
Daniel Olshansky
bb17b733a0984acfbc8d8b875c209d