Hope somebody can point me in the right direction in solving this problem. I have this bash with if statement.
checkPID=(MySQL queries to count columns)
if [[ $checkPID -eq 1 ]]
then
echo "PID already exist, running update queries instead"
(MySQL update queries here)
else
echo "PID does not exist, running insert queries"
(MySQL insert queries here)
fi
When I run this bash script on the command line everything works as expected, but when I automate this via crontab it doesn't follow the if condition regardless of the value of the checkPID variable.