node.js - Nodejs-cron for logging
问题描述
Hi I'm trying to make a cronjob for From this month on, they will work at 10.00 pm on the first day of each month. My try is ( i created this from cron-expression-generator )
var job = new CronJob('0 0 12 1 1/1 ? *', function() {
let UserCount=0;
User.count({}, function( err, count){
console.log(count);
});
}, null, true, ' ..somewhere_in_world..');
job.start();
But it gives error
throw new Error('Too many fields');
Also it works fine as every second like
var job = new CronJob('* * * * * *', function() {
How can I make it Thank you
解决方案
我相信您的问题已经得到解答,只需添加很酷的网站链接以在将来提供帮助
推荐阅读
- .htaccess - .htaccess 使用 RewriteCond% {TIME} 重定向特定文件夹
- xcode - 安装 Cocoapods 的问题
- javascript - Chrome扩展弹出页面滚动在mac os上不起作用
- python - 如何不拆分字符串以检索用户名,但不拆分包含无效字符的用户名
- axios - 编码为等待时,forEach 正在运行请求
- puppeteer - 有没有办法从 Puppeteer 点击地址栏中的“站点信息”按钮?
- json - 使用 SuperObject 获取键值时缺少 JSON 键如何处理?
- css - 发布时 Wordpress 不居中对齐图像
- roc - 如何计算负类的精确召回率、ROC 和 f1 分数?
- xml - Spoon PDI 中的 XML 输入