Cron Job execute curl only if file has been modified
Hi
I need to execute a command in cron job, but only if a file has been touched. Currently, my cron command is: curl "..." where "..." is my target link. I am new to this but I did manage to find something online. Hoping that someone with experience can confirm that the command below is correct:
[PHP]usr/local/bin/php [/tmp/.lastupdate -nt /my_dir_name/my_filename ] || (curl "https://...index.php?controller..." ; touch /tmp/.lastupdate)[/PHP]
Thank You.
-
Figured it out: [ /tmp/lastupdate -nt /my_dir_name/my_filename ] || (curl "https://...index.php?controller..." ; touch /tmp/lastupdate)0 -
Hi @nrcjea001, I'm glad to see you were able to find a cron job command that worked for what you needed. Thanks for sharing the outcome! 0
Please sign in to leave a comment.
Comments
2 comments