2014-04-29 45 views
0

我想爲我的一個項目設置cron作業,它在我的域上使用名爲VMS的子文件夾工作。Cronjob不能使用CodeIgniter

我已經創建了cron作業帶控制器:

file: main.php 
    Class: Main 
    Method: ExpiryAlertMail 
Location: public_html/vms/application/controllers/main.php 

我會嘗試下列方法來運行cron作業,但它給我不同的-2的錯誤消息不同-2例。那麼,我怎樣才能在一天內運行我的cron工作?

在/ usr /本地/ PHP4 /斌/ PHP /home//public_html/vms/index.php主要ExpiryAlertMail

在/ usr/bin中/ PHP -q /家//的public_html/VMS /指數.PHP主要ExpiryAlertMail >>的/ dev/null的

在/ usr/bin中/ PHP /home//public_html/vms/index.php主要ExpiryAlertMail

在/ usr/bin中/ PHP /家//的public_html/VMS /index.php

0 13 * * * php home // public_html/vms/index.php main/ExpiryA lertMail

PHP /home//public_html/vms/cron.php /主/ ExpiryAlertMail

〜/的public_html/VMS/index.php的主ExpiryAlertMail

http://www.domain.com/vms/main/ExpiryAlertMail的wget

PHP -q /家//的public_html/VMS /的index.php?C =主&米= ExpiryAlertMail

的/ usr /斌/ PHP-CLI /home//public_html/vms/index.php主ExpiryAlertMail PHP /家//的public_html /vms/cron.php主/ ExpiryAlertMail

的wget -O - -q -t 1 http://www.domain.com/vms/cron/run

+0

你得到的錯誤信息是什麼? – Abrixas2

+0

案例:php/home /用戶名/ public_html/vms/cron.php/main/ExpiryAlertMail msg:您無權訪問此頁面,請聯繫管理員! 案例:php home/username/public_html/vms/index.php main/ExpiryAlertMail msg:您無權訪問此頁面,請聯繫管理員! – user3567380

+0

案例:wget http://www.domain.com/vms/main/ExpiryAlertMail Msg:發送HTTP請求,等待響應... 406不可接受 10:35:01錯誤406:不可接受。 – user3567380

回答

0

如果你的腳本可以通過URL請求,您可以嘗試

0 13 * * *捲曲「[腳本網址]'

+0

案件:捲曲'[http://www.domain.com/vms/main/ExpiryAlertMail]' Msg:curl:(3)[globbing]非法模式或範圍規格後pos 2 – user3567380

+0

@ user3567380:它應該是'curl'domain.com/vms/main/ExpiryAlertMail',括號是爲了指出佔位符。 – Abrixas2

+0

Case:curl'http://www.domain.com/vms/main/ExpiryAlertMail' Msg:%Total%Received%Xferd平均速度時間時間時間當前 Dload上傳總花費左速度 100 372 100 372 0 0 50101 0 - : - : - - : - : - - - : - : - 50101 100 372 100 372 0 0 49759 0 - : - : - - : - - : - - : - : - 0 406不可接受

406不可接受

此請求不可接受
user3567380