I'm trying to run my first cron job on MAC OS (my localhost is running MAMP).
To access crontab, to run a cron job, I'm typing the following into the command line:
crontab -e
Then I press i on the keyboard to go into insert mode to insert the cron job.
The cron job inserted is
* * * * * wget http://localhost:8888/project/cron.php
Then I press esc and type :wq in the command line.
I then get a message:
installing new crontab
Then I check what cronjobs are running with crontab -l and it says:
* * * * * wget http://localhost:8888/project/cron.php
But nothing happens...
On a separate note, below is the script I'm executing as a test script in the cron.php file. It is meant to generate a new time stamp in a text file in the root of the project (the cron job is supposed to make this happen every minute):
<?php
$file = dirname(__FILE__) . '/output.txt';
$data = "hello, it's " . date('d/m/Y H:i:s') . "\n";
file_put_contents($file, $data, FILE_APPEND);
?>
If anyone has any advice as to why this isn't working I'd be hugely grateful.
I've tried the steps shown above at both system level (i.e macmini) and also in my 'project' folder.
I'm completely new to all of this so any help would be amazing.