I have a cron pattern 0 0 0/6 ? * *
for every six hour. i have used Nodejs cron for executing cron job, below is my code:
var CronJob = require('cron').CronJob;
new CronJob('0 0 0/6 ? * *', function() {
console.log(new Date(), 'Every 6 hours');
try {
// task to be executed
} catch (e) {
console.log(e);
}
}, function() {},
true
).start();
I got this exception during startup of my program:
"stack": [
"Error: Field (?) cannot be parsed",
" at Object._parseField (/home/ajit/git/test/BackEnd/node_modules/cron/lib/cron.js:344:11)",
" at Object._parse (/home/ajit/git/test/BackEnd/node_modules/cron/lib/cron.js:308:9)",
I have checked this pattern at this website: http://www.cronmaker.com/ , it says my cron is valid . I have searched over internet and i am unable to get a valid 6 digit cron pattern without ?
.