Crontab 無法運作,系統無法重新啟動

Crontab 無法運作,系統無法重新啟動

昨天我創建了簡單的 crontab 任務。我覺得寫得很好。今天我登入我的伺服器並檢查時間。我的 crontab 任務不起作用,因為晚上系統不會重新啟動。當然我知道,伺服器重啟是沒有用的,但我只想這樣做只是為了測試。

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
  2 57  *  *  * root dnf check-update && dnf upgrade -y
  3 33  *  *  * root reboot
  3 44  *  *  * root ./backup.sh
  4 15  *  *  * root screen -dmS minkraft java -Xincgc -Xmx1555M -jar /minkraft/bukkit.jar nogui

答案1

你已經迷茫了分分鐘小時crontab 作業中的值。由於這個問題,前三個作業可能無法正常運作。

例如:

3 33 * * *= 3 分鐘 33 小時 -> 行不通!

33 3 * * *= 33 分鐘 3 小時 -> 像這樣改變它。

相關內容