我想每周做一次口交,所以我想使用anacron。
因此,我在/etc/anacrontab中添加了以下一行
7 1 AGDienste.weekly /bin/sh /home/bjoern/Hockey/cronWeeklyAGDiensteGitCommit.shcronWeeklyAGDiensteGitCommit.sh的含量是
#!/bin/sh
cd /home/bjoern/Hockey/AGDienste
git add .
git commit --allow-empty -m "Weekly duties update `date +'%Y-%m-%d %H:%M'`"
git push手动运行这个脚本非常好。但是试图使用sudo anacron -f执行anacron会导致/var/log/syslog中的以下行
Sep 20 23:13:52 XPS-9370 anacron[7087]: Will run job `AGDienste.weekly' in 1 min.
Sep 20 23:13:52 XPS-9370 anacron[7087]: Will run job `cron.daily' in 5 min.
Sep 20 23:13:52 XPS-9370 anacron[7087]: Will run job `cron.weekly' in 10 min.
Sep 20 23:14:52 XPS-9370 anacron[7087]: Job `AGDienste.weekly' started
Sep 20 23:14:53 XPS-9370 anacron[7087]: Job `AGDienste.weekly' terminated (exit status: 128) (mailing output)
Sep 20 23:14:53 XPS-9370 anacron[7087]: Can't find sendmail at /usr/sbin/sendmail, not mailing output有人能帮忙吗?
发布于 2018-09-21 05:10:14
好吧,我发现问题了。
我推动的回购是一个github回购,所以我需要提供一个电子邮件和密码。我已经提供了它们,并使用git config credential.helper store作为普通用户来保存它们。但是anacron必须以root用户的身份运行,所以它还需要一次电子邮件和密码。所以我跑了
sudo -s
/bin /sh /home/bjoern/Hockey/cronWeeklyAGDiensteGitCommit.sh用手提供了一次。现在,sudo anacron -f的工作非常完美。
https://askubuntu.com/questions/1077053
复制相似问题