我在OS Debian中使用cron文件,使用这样的行:
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
0 0 * * * php -q /var/www/bbs/public_html/worker/get.php 'domain=someDomain' < /dev/null > /var/www/bbs/public_html/worker/log/someDomain.log &
是否可以在cron文件中创建变量并放入路径:
/var/www/bbs/public_html/worker/
在像这样的代码中使用它:
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
0 0 * * * php -q $VARIABLE/get.php 'domain=someDomain' < /dev/null > $VARIABLE/log/someDomain.log &
答案 0 :(得分:0)
我找到了解决方案
TESTDIR=/home/user/test
* * * * * $TESTDIR/script.sh
似乎有效。