PHPファイルをパス/var/www/html/rss_feed/mirror.php
にcronタブで実行しようとしています。このため私は以下の手順を実行しました。 PHPスクリプトを実行するためのCrontabのスケジュール
sudo crontab -e
は、その後、私はあなたが以下を参照することができますPHPファイルを実行するごとに2分後にcronタブをスケジュールするために挿入されたコードの行があるので、次のコード
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# avt 5 a.m every week with:
# 0 5 * * 1 tar -zcf /ar/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
*/2 * * * * /usr/bin/php /var/www/html/rss_feed/nbt_times.php
#
# m h dom mon dow command
を挿入することで、ファイルを編集しました。
*/2 * * * * /usr/bin/php /var/www/html/rss_feed/nbt_times.php
私も
2 * * * * lynx -dump http://192.168.0.232/rss_feed/mirror.php > /dev/null 2>&1
もこの
2 * * * * /your/path/to/php /var/www/html/rss_feed/nbt_times.php
と異なる記事からより多くのフォーマットを以下試してみました。
PHPスクリプトが実行されていません。コードを別の場所に置く必要がありますか?それとも、私は間違った方向にいる。あなたは何が問題であるかを知るのを助けてくれますか?
エラーログを確認しますか? –
エラーログにもエントリがありません。私はmirror.phpを探しました。しかし、何も得られなかった –
コマンドラインからPHPファイルを実行する - それは動作しますか? – Andrew