IP 없이 부팅하기 위한 crontab이 작동하지 않습니다.

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

cronjob을 루트로 추가하려면 "sudo crontab -e"를 사용하는 편이 낫습니다(cronjob 내에서 sudo를 수행하는 것을 피하세요).

또한 나는 당신이 noip2(/home/username/noip-2.1.9-1 폴더에 위치)를 실행하기를 원한다는 것을 알고 있습니다. 그래서 cronjob을 다음으로 변경하겠습니다.

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

답변2

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

관련 정보