0

crontab を編集しましたが、古い設定がまだ実行されています。これが私のcrontabリストです:

[root@semanticvalley etc]# for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
no crontab for root
no crontab for bin
no crontab for daemon
no crontab for adm
no crontab for lp
no crontab for sync
no crontab for shutdown
no crontab for halt
no crontab for mail
no crontab for news
no crontab for uucp
no crontab for operator
no crontab for games
no crontab for gopher
no crontab for ftp
no crontab for nobody
no crontab for dbus
no crontab for vcsa
no crontab for mailnull
no crontab for smmsp
no crontab for sshd
no crontab for apache
## ----- Begin HSPC generated text. Do not edit! ----- another_site.com
## ----- End HSPC generated text. ----- another_site.com

MAILTO=''
## ----- Begin HSPC generated text. Do not edit! ----- comehike.com
MAILTO='alex.genadinik@gmail.com'
30 13 * * * php /home/webadmin/comehike.com/html/utils/post_hike.php
## ----- End HSPC generated text. ----- comehike.com

MAILTO=''
no crontab for rpc
no crontab for popa3d
no crontab for pcap
no crontab for nscd
no crontab for rpm
no crontab for named
no crontab for mysql
no crontab for xfs
no crontab for spfmilt
no crontab for genadinik
## ----- Begin HSPC generated text. Do not edit! ----- somesite.com
## ----- End HSPC generated text. ----- somesite.com

しかし、新しい crontab を設定したサイトは、このリストにも表示されません。正しく設定するには、何を変更/編集する必要がありますか?

明確にするために、これは古いcrontabでした:

MAILTO=''
## ----- Begin HSPC generated text. Do not edit! ----- comehike.com
MAILTO='alex.genadinik@gmail.com'
30 13 * * * php /home/webadmin/some_url/some_path.php
## ----- End HSPC generated text. ----- comehike.com

私が設定した新しいcrontabはここにも表示されません。しかし、 cat /etc/crontab を実行すると、新しい設定が表示されます。

ありがとう!

4

1 に答える 1

3

crontab を編集する正しい方法は、次のようにすることです。

crontab -e

シェルまたはユーザーのスクリプトから実行する場合は、次のこともできます。

less setting_file | crontab -u user

ここで、setting_file は新しい設定を含むファイルです。それが役立つことを願っています。

于 2012-12-30T03:54:42.630 に答える