I want my node.js program to automatically execute at midnight or some particular time, every day.
I have some idea about cron, but can anyone specify me how to do this?
I want my node.js program to automatically execute at midnight or some particular time, every day.
I have some idea about cron, but can anyone specify me how to do this?
On Linux, you can simply run crontab -e
which will open a cron file in your default editor.
Then to have your node program running every day at midnight you'd have to enter :
00 00 * * * node /path/yournodeapp.js
And save it.
I suggest you read a bit about cron jobs, they are quite powerful but very easy to use.
This is my usual cheatsheet.
Look into the cron module on NPM. It allows you to execute arbitrary node.js code at predefined intervals or times of day.