crontab -l
및 의 출력 crontab
이 다릅니다.
root@ce:~# crontab -l
0-59 * * * * curl http://ce.scu.ac.ir/courses/admin/cron.php?password=mypass
* * * * * ntpdate –s ir.pool.ntp.org
* * * * * php /var/www/html/shub/ow_cron/run.php
root@ce:~# cat /etc/crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
*/01 * * * * www-data /var/www/html/shub/ow_cron/run.php
*/1 * * * * www-data /usr/bin/php7.0 /var/www/html/courses/admin/cli/cron.php > /var/log/moodle/cron.log
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
일부 문서는 crontab -e
cron 작업을 정의하는 데 사용한다고 말했기 때문에 요청합니다 . crontab -e
또는 사용해야합니까 vim /etc/crontab
?
crontab -l
에 crontab
저장된 실행중인 사용자의를 표시합니다 /var/spool/cron/crontabs
. 거기에 정의 된 모든 것은 해당 사용자의 사용자 ID로 실행됩니다. 이것은 특히하지 않습니다 root
,하지만 root
하나를 가질 수 있습니다.
/etc/crontab
반면에는 시스템 전체의 기본 crontab (와 함께 /etc/cron.d
)이 포함되어 있습니다. 해당 파일의 항목에는 사용자 이름에 대한 추가 필드가 있으며 여기에서 정의 된 작업은 해당 사용자 ID로 실행됩니다.
둘 중 하나를 사용하거나 파일을 만들어에서 cronjob을 정의 할 수 있습니다 /etc/cron.d
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다