I have this script using the npm module node-shedule. I think I run it every 6 hours, but it works for an hour, when the hour is 0.6,12,18. it can only be started once. I could fix this dirty with a bool, but that is not my style.
a cronjob on Linux is also not an option, it needs to run cross-platform
let schedule = require('node-schedule');
let j = schedule.scheduleJob('* */6 * * *', function() {
do smt
});
source
share