I have this jquery code:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
setInterval(
function (){
$.get('update.php',function (){
});
},1000
);
</script>
It calls my update.php file every second which updates the database. This works without any problem when I manually run it on the browser but it doesn’t work through CRON. What can I do to make it work through CRON jobs?
In your CRONTAB, you’ll want to run update.php. Javascript/jQuery is run client-side. When setting up a CRON Job, you are running a command on the server, in this case, a PHP script. As such, only the PHP will run.
An example entry in CRONTAB:
This will run the command php every minute, passing it update.php as an argument.
More information about CRON format: http://www.nncron.ru/help/EN/working/cron-format.htm