I am trying to write a cronjob to do an action if replicationTest.txt does not exist and replicationTestSeen.txt does exist in a specific directory. Right now what I am doing is not working. Here is the what I am doing:
0 3 * * 0 [ [ ! -e /dv1/replicationtest/replicationTest.txt ] && [ -e /dv1/replicationtest/replicationTestSeen.txt ] ] && echo 'replication passed' | mail -s 'Replication Test Passed' myemail@email.com || echo ' replication failed' | mail -s 'Replication failed' myemail@email.com
Even when the conditions are right for the cron to email replication passed it still emails replication failed.