問題:
I need to add a cron job thru a script I run to set up a server.我需要通過我運行的腳本來添加一個 cron 作業來設置服務器。 I am currently using Ubuntu.我目前正在使用 Ubuntu。 I can use crontab -e
but that will open an editor to edit the current crontab.我可以使用crontab -e
但這將打開一個編輯器來編輯當前的 crontab。 I want to do this programmatically.我想以編程方式執行此操作。
Is it possible to do so?有可能這樣做嗎?
解決方案:
參考一: https://en.stackoom.com/question/KTaM參考二: https://stackoom.com/question/KTaM