.png)
Linux 19.04를 사용하는 서버가 있습니다.
처음에는 다음을 수행했습니다.nano /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
13 * * * * root cd / && run-parts --report /etc/cron.hourly
18 00 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
33 00 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
43 00 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
#
줄 앞 끝에 이것을 추가했습니다.
*/1 * * * * curl -s "https://www.example.com/abc" > /dev/null
답변1
이 파일이 그런 목적으로 만들어졌는지는 모르겠지만 일반적으로 표준 cron 기능을 사용하여 정기적으로 작업을 실행하지만 가능할 수도 있습니다. 하지만 보시다시피 이 파일에는 사용자 필드가 있으므로 해당 필드도 채워야 하며 그 후에는 확실히 yoy sould retart cron을 입력해야 합니다.
sudo systemctl cron.service 다시 시작