我需要启动一个用nodejs编写的实用程序,让我们说每X分钟。 我选择了crontab,
我的crontab看起来像
* * * * * /bin/bash /home/michy/run-lola-run.sh
和我的剧本
#! /bin/bash
cd /home/michy
touch test_before #testing to see the script runs
/usr/bin/node /home/michy/update.js
touch test_after #testing to see the script hanged or crashed
这里的节点update.js'仅使用' crontab -e' 运行,并且不会与' sudo crontab -e'
一起运行但是我的脚本 run-lola-run.sh 运行这两种情况,并在两种情况下创建文件( test_before,test_after )
/ var / log / syslog
中没有报告错误谢谢