這個是安裝了最新版本的truenas scale時發現的問題。如何處置呢?等下一個版本?No. 自行解決。
首先安裝cron服務
apt-get update && apt-get install cron
安裝完了立馬把原來的cron任務停了, 因爲貌似是不好用的。
crontab -u www-data -e
將裡面的任務刪除。
接下來,將任務運行在當前docker的root用戶下面:
crontab -e
其中的任務表, 這裡假設你把nextcloud安裝到/var/www/html下邊了:
*/5 * * * * sudo -u www-data php -f /var/www/html/cron.php
docker故障解決
cron運行cron.php時報錯 bash: sudo: command not found
一個命令解決
apt-get install sudo
運行crontab -e編輯crontab任務時發生錯誤
no crontab for root - using an empty one update-alternatives: error: no alternatives for editor /usr/bin/sensible-editor: 25: editor: not found /usr/bin/sensible-editor: 28: nano: not found /usr/bin/sensible-editor: 31: nano-tiny: not found /usr/bin/sensible-editor: 34: vi: not found Couldn't find an editor! Set the $EDITOR environment variable to your desired editor. crontab: "/usr/bin/sensible-editor" exited with status 1
安裝一個編輯器就解決了
apt-get install vim
或者執行
apt-get install vim-tiny
然後再重新在命令行裡輸入
crontab -u www-data -e
解決問題