我正在监控我的 crontab 日志,看到了以下内容:
Jun 12 20:17:01 HP250G3 CRON[4798]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
这是正常的吗?我从来没有为 root 设置过任何 cron 作业。
感谢您的任何帮助!
答案1
是的,很正常。
从man run-parts
NAME
run-parts - run scripts or programs in a directory
在你的情况下,run-parts
运行文件夹中的所有脚本/etc/cron.hourly
我的/etc/cron.hourly
是空的因此/etc/cron.daily
% ls -og /etc/cron.daily
total 88
-rwxr-xr-x 1 311 Dez 29 00:15 0anacron
-rwxr-xr-x 1 625 Mär 9 12:55 apache2
-rwxr-xr-x 1 376 Mär 2 10:50 apport
-rwxr-xr-x 1 15481 Nov 3 2014 apt
-rwxr-xr-x 1 314 Feb 10 11:23 aptitude
-rwxr-xr-x 1 355 Dez 10 2014 bsdmainutils
-rwxr-xr-x 1 384 Okt 24 2014 cracklib-runtime
-rwxr-xr-x 1 532 Mär 23 16:31 debsums
-rwxr-xr-x 1 1597 Jan 17 02:10 dpkg
lrwxrwxrwx 1 47 Jun 8 22:59 google-chrome-beta -> /opt/google/chrome-beta/cron/google-chrome-beta
-rwxr-xr-x 1 372 Jan 22 2014 logrotate
-rwxr-xr-x 1 1293 Jan 1 00:16 man-db
-rwxr-xr-x 1 435 Nov 18 2014 mlocate
-rwxr-xr-x 1 249 Dez 2 2014 passwd
-rwxr-xr-x 1 2417 Mai 13 2013 popularity-contest
-rwxr-xr-x 1 982 Nov 30 2014 rkhunter
-rwxr-xr-x 1 2798 Feb 2 05:26 spamassassin
-rwxr-xr-x 1 441 Okt 25 2014 sysstat
-rwxr-xr-x 1 728 Mär 27 03:07 tomcat7
-rwxr-xr-x 1 214 Jan 20 10:39 update-notifier-common
脚本以默认定义开始/etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
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 )
#
答案2
是的,这个 cronjob 默认存在。它每小时运行一次并执行脚本/etc/cron.hourly/
(如果有的话)。