no-IP 시작을 위한 Crontab이 작동하지 않습니다.

no-IP 시작을 위한 Crontab이 작동하지 않습니다.

웹서버에 문제가 있습니다. 일반적으로 를 통해 No-IP-DUC를 시작합니다 sudo noip2. cronjob을 사용하여 자동화하려고 했습니다. 을 사용하여 crontab -e다음 파일을 만들었습니다.

# 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

@reboot cd /home/username/noip-2.1.9-1 && sudo noip2

작동하지 않으며 이유를 모르겠습니다. 누군가가 나를 도울 수 있다면 좋을 것입니다.

답변1

하는 대신

cd /home/사용자 이름/noip-2.1.9-1 && sudo noip2

차라리 "sudo crontab -e"를 실행하여 cronjob을 루트로 추가하고 싶습니다(그리고 cronjob 내에서 sudo를 수행하는 것을 피하세요).

또한 noip2(/home/username/noip-2.1.9-1 폴더에 있음)를 실행하고 싶다는 것을 이해합니다. 그래서 cronjob을 다음과 같이 변경합니다.

@reboot /home/username/noip-2.1.9-1/noip2

답변2

대체 솔루션을 찾았습니다. 라우터를 No-IP에 연결했는데 이제 작동합니다.

관련 정보