提前感谢大家。使用 crontab 时遇到一些问题
我的 sh 脚本是使用特定文件夹内的图像在文件夹中创建电影。
*/5 * * * * sh /bin/script.sh
如你所见,我已将脚本上传到 bin 中,我需要它每 5 分钟运行一次
在我的 sh 里面我有这个;
#!/bin/bash
echo "Hey there, this is the timelapse script lets see if its running"
ffmpeg -f image2 -r 25 -pattern_type glob -i /home/pi/11/april2020/'*.jpg' -q:a 3 -s 1920x1080 -c:v wmv1 /home/pi/11/april2020/output/video.wmv
当我执行服务 cron 状态时这就是我得到的
Jan 01 15:20:01 raspberrypi CRON[20036]: (pi) CMD (sh /bin/timelapse.sh)
Jan 01 15:20:02 raspberrypi cron[19982]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 01 15:20:02 raspberrypi postfix/sendmail[20040]: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 01 15:20:03 raspberrypi CRON[20035]: (pi) MAIL (mailed 28980 bytes of output but got status 0x004b from MTA
)
Jan 01 15:20:03 raspberrypi CRON[20035]: pam_unix(cron:session): session closed for user pi
Jan 01 15:25:01 raspberrypi CRON[20059]: pam_unix(cron:session): session opened for user pi by (uid=0)
Jan 01 15:25:01 raspberrypi CRON[20060]: (pi) CMD (sh /bin/timelapse.sh)
Jan 01 15:25:02 raspberrypi cron[19982]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 01 15:25:02 raspberrypi CRON[20059]: (pi) MAIL (mailed 28980 bytes of output but got status 0x004b from MTA)
Jan 01 15:25:02 raspberrypi CRON[20059]: pam_unix(cron:session): session closed for user pi
请帮助我,我被这个问题困住了,我不明白为什么它不起作用。