Reputation: 129
I have problem with adding CRON rules to synology DS214se.
I add line to /etc/crontab
* * * * * root /volume1/web/gym/bin/cron/cronTabTest.php
Save crontab and restart him with
/usr/syno/sbin/synoservicectl --restart crond
Restart NAS box.
What im doing wrong? Please help me.
This is cronTabTest.php:
<?php
$file = 'test.txt';
file_put_contents($file, date('Y-m-d H:i:s').' ',FILE_APPEND);
echo 'cron';
?>
Upvotes: 1
Views: 1701
Reputation: 73251
First your cron line is missing php
at the beginning. Change the line
* * * * * root /volume1/web/gym/bin/cron/cronTabTest.php
to
* * * * * root /usr/bin/php /volume1/web/gym/bin/cron/cronTabTest.php
Second, when working on the cli, you will need to make sure to provide the full path from your server's root for all your files you are calling. For example:
$file = '/volume1/web/gym/bin/cron/test.txt';
file_put_contents($file, date('Y-m-d H:i:s').' ',FILE_APPEND);
echo 'cron';
Upvotes: 1