이것은크로네 로그일부 스크립트를 실행하는 컴퓨터(인터넷 연결):
luis@Fostrot:~$ sudo tail -n 50 /var/log/syslog | grep "cron" -i
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11014]: (root) CMD (/bin/bash --login -i -c Reconectador3G.sh)
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11013]: (root) CMD (/bin/bash --login -i -c ReportarIP.sh)
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11015]: (root) CMD ( /bin/ReconectadorVPN.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11224]: (root) CMD (/bin/bash --login -i -c Reconectador3G.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11227]: (root) CMD (/bin/bash --login -i -c ReportarIP.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11225]: (root) CMD ( /bin/ReconectadorVPN.sh)
Jan 19 21:39:01 Fostrot /USR/SBIN/CRON[11452]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11477]: (root) CMD ( /bin/ReconectadorVPN.sh)
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11478]: (root) CMD (/bin/bash --login -i -c Reconectador3G.sh)
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11481]: (root) CMD (/bin/bash --login -i -c ReportarIP.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11832]: (root) CMD (/bin/bash --login -i -c ReportarIP.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11831]: (root) CMD ( /bin/ReconectadorVPN.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11833]: (root) CMD (/bin/bash --login -i -c Reconectador3G.sh)
이것은 크론탭입니다 sudo
:
luis@Fostrot:~$ sudo crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /bin/bash --login -i -c Reconectador3G.sh
*/5 * * * * /bin/bash --login -i -c ReportarIP.sh
보시다시피출입 불가을 위한 ReconectadorVPN.sh
. 다른 사용자에게는 crontab이 없거나 다음과 같습니다.
luis@Fostrot:~$ crontab -l
no crontab for luis
모든 사용자의 crontab도 확인했습니다.
root@Fostrot:/home/luis# awk -F: '{print $1}' /etc/passwd | xargs -l1 crontab -lu
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /bin/bash --login -i -c Reconectador3G.sh
*/5 * * * * /bin/bash --login -i -c ReportarIP.sh
no crontab for daemon
no crontab for bin
no crontab for sys
no crontab for sync
no crontab for games
no crontab for man
no crontab for lp
no crontab for mail
no crontab for news
no crontab for uucp
no crontab for proxy
no crontab for www-data
no crontab for backup
no crontab for list
no crontab for irc
no crontab for gnats
no crontab for nobody
no crontab for libuuid
no crontab for mysql
no crontab for messagebus
no crontab for colord
no crontab for usbmux
no crontab for miredo
no crontab for ntp
no crontab for Debian-exim
no crontab for avahi
no crontab for beef-xss
no crontab for dradis
no crontab for pulse
no crontab for speech-dispatcher
no crontab for haldaemon
no crontab for iodine
no crontab for postgres
no crontab for sshd
no crontab for snmp
no crontab for stunnel4
no crontab for statd
no crontab for sslh
no crontab for Debian-gdm
no crontab for rtkit
no crontab for saned
no crontab for manolo
no crontab for luis
no crontab for dnsmasq
no crontab for arpwatch
no crontab for redsocks
...그들 중 어느 것도 ReconectadorVPN.sh
스크립트에 대한 항목이 없습니다.
여기서 무슨 일이 일어나고 있으며 어떻게 해야 합니까?위치 통화ReconectadorVPN.sh
대본 에 ?
답변1
크론 매뉴얼 페이지에서:
Cron searches /var/spool/cron for crontab files which are named after accounts in crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the directory, which are in a differ- ent format (see crontab(5) ).
사용자 crontab을 살펴보았지만 없는 것 같습니다 /etc/crontab
. 일반적으로 여러 cron 디렉토리에서 항목을 실행하기 위한 항목이 포함되어 있습니다.
답변2
요즘 crontab을 찾아야 할 곳이 몇 군데 있습니다:
물론 개별 사용자 crontab은 일반적으로 사용자 루트 및 기타 사용자의 crontab을 포함하는 /var/spool/cron/에 있습니다.
/etc/crontab에 루트 전용 crontab이 있습니다. 내가 아는 한 여기에는 각 작업의 파일이 있는 실행 섹션 디렉터리에 대한 참조가 포함되어 있습니다. 일반적으로 /etc/cron.daily /etc/cron.hourly /etc/cron.monthly에 있습니다.
요즘 crontab을 찾을 수 있는 또 다른 영역은 /etc/cron.d/ 디렉토리 아래인데, 내가 알 수 있듯이 요즘 이 디렉토리가 더 인기를 얻고 있는 것 같습니다. 이러한 영역의 파일은 일반적으로 루트 수준 실행에 사용됩니다.