
我的 crontab 中有這個:
59 23 * * * /home/peter/Documents/script.py > /home/peter/Documents/log.log 2>&1
但我不斷/bin/sh: 1: /home/peter/Documents/script.py: not found
進入 log.log 檔案。我什至嘗試在 /home 之前添加 cd 腳本,但它仍然無法工作。我還需要做什麼?
ls -la 輸出:-rwxrwxr-- 1 peter peter 603 Jul 18 16:08 /home/peter/Documents/script.py
答案1
好吧,評論夠多了;)……
編輯您的腳本並添加正確的 shebang:
#!/usr/bin/env python3