raven79
15.08.11, 10:26
Hallo an alle :),
ich hab wie oben geschieben einen Zxyel NAS210 auf dem LINUX (2.6.24.4) als BS lauft. Jetzt hab ich nach längerem suchen über google rausgefunden wie und wo ich einen Cronjob einrichten kann. Mein Ziel ist es eine php Datei mit code auszuführen. Für den Anfang will ich nur die Zeit wann der Cronjob ausgeführt wurde in eine txt Datei zu schreiben.
Inhalt PHP Datei:
#!/i-data/439ce182/.zyxel/zy-pkgs/php/bin/php
<?php
$datum = date("l dS of F Y h:i:s");
$information = $datum. "\r\n";
$datei_handle=fopen("log.txt",a);
fwrite($datei_handle,$information);
fclose($datei_handle);
echo '<br />';
?>
Wenn ich
crontab -l aufrufe kommt:
# Run ntpdate periodically if users want to sync time from time server
* * * * * /bin/dsrv-mon.sh > /dev/null 2>&1
17 */2 * * * /bin/rbm.sh by_crond > /dev/null 2>&1
#*/10 * * * * /usr/bin/ipcam > /dev/null 2>&1
50 16 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
50 4 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
14 0 16 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
14 0 31 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
25 */8 * * * smartd-runner.sh cli > /dev/null 2>&1
Nun bearbeite ich den Crontab mit
crontab -e
und mein ergebinss sieht dann so aus:
# Run ntpdate periodically if users want to sync time from time server
* * * * * /bin/dsrv-mon.sh > /dev/null 2>&1
17 */2 * * * /bin/rbm.sh by_crond > /dev/null 2>&1
#*/10 * * * * /usr/bin/ipcam > /dev/null 2>&1
50 16 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
50 4 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
14 0 16 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
14 0 31 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
25 */8 * * * smartd-runner.sh cli > /dev/null 2>&1
#Test Cronjob cron.php Zeitstempel
*/5 * * * * /i-data/439ce182/www/cron.php > /dev/null
Der Befehl wird nie ausgefürt und nach einem neustart des NAS ist mein Cronjob weg.
Kann mir da jemand helfen und sagen was ich anders machen muß / wo meine fehler sind...
Danke
Gruß Micha
ich hab wie oben geschieben einen Zxyel NAS210 auf dem LINUX (2.6.24.4) als BS lauft. Jetzt hab ich nach längerem suchen über google rausgefunden wie und wo ich einen Cronjob einrichten kann. Mein Ziel ist es eine php Datei mit code auszuführen. Für den Anfang will ich nur die Zeit wann der Cronjob ausgeführt wurde in eine txt Datei zu schreiben.
Inhalt PHP Datei:
#!/i-data/439ce182/.zyxel/zy-pkgs/php/bin/php
<?php
$datum = date("l dS of F Y h:i:s");
$information = $datum. "\r\n";
$datei_handle=fopen("log.txt",a);
fwrite($datei_handle,$information);
fclose($datei_handle);
echo '<br />';
?>
Wenn ich
crontab -l aufrufe kommt:
# Run ntpdate periodically if users want to sync time from time server
* * * * * /bin/dsrv-mon.sh > /dev/null 2>&1
17 */2 * * * /bin/rbm.sh by_crond > /dev/null 2>&1
#*/10 * * * * /usr/bin/ipcam > /dev/null 2>&1
50 16 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
50 4 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
14 0 16 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
14 0 31 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
25 */8 * * * smartd-runner.sh cli > /dev/null 2>&1
Nun bearbeite ich den Crontab mit
crontab -e
und mein ergebinss sieht dann so aus:
# Run ntpdate periodically if users want to sync time from time server
* * * * * /bin/dsrv-mon.sh > /dev/null 2>&1
17 */2 * * * /bin/rbm.sh by_crond > /dev/null 2>&1
#*/10 * * * * /usr/bin/ipcam > /dev/null 2>&1
50 16 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
50 4 * * * /sbin/ntpdate_sync.sh > /dev/null 2>&1
14 0 16 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
14 0 31 * * /usr/bin/zyfw_downloader ftp://ftp2.zyxel.com/NSA210/firmware ZYFW_INFO.tgz 0 1 > /dev/null 2>&1
25 */8 * * * smartd-runner.sh cli > /dev/null 2>&1
#Test Cronjob cron.php Zeitstempel
*/5 * * * * /i-data/439ce182/www/cron.php > /dev/null
Der Befehl wird nie ausgefürt und nach einem neustart des NAS ist mein Cronjob weg.
Kann mir da jemand helfen und sagen was ich anders machen muß / wo meine fehler sind...
Danke
Gruß Micha