我正在尝试创建一个 cron 作业来从 Google 日历中获取 iCal 文件并将其导入到 calcurse。
以下是脚本google_sync.sh:
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export DISPLAY=:0.0
wget https://calendar.google.com/calenddar/ical/<<my email>>/<<my key>>/basic.ics -O ~/.calcurse/dumps/google.sam.ics
calcurse -i /home/sam/.calcurse/dumps/google/sam.ics
uniq /home/sam/.calcurse/apts > /home/sam/.calcurse/temp
cat /home/sam/.calcurse/temp > /home/sam/.calcurse/apts
rm /home/sam/.calcurse/temp
这是我添加的内容chrontab -e
*/20 * * * * /usr/bin/sh /home/sam/.calcurse/scripts/google_sync.sh
答案1
您的申请链接不正确:/usr/bin/sh
应该是/bin/sh