I am using supervisor to start node server. There is options in "supervisor --help" called
-p|--poll-interval How often to poll watched files for changes. Defaults to Node default.
But it is not what I want. I'd like to run "git pull" in shell in every 1 minute. Is there anyway to do it? It could be in NPM or supervisor, or something else.
Use cron job in linux/unix, and task scheduler for windows. And they're similar.
For cron job, first write a shell script to do what you want, like git pull
something. Suppose it's /scripts/git_pull_job.sh
, and make it executable.
chmod 755 /scripts/git_pull_job.sh
Then add the job. In the terminal input:
crontab -e
Then in the VI
style editor, input things like below, and save and close as VI
. It will run every minute.
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
* * * * * /scripts/git_pull_job.sh
why not just run a cron job? git is not a node functionality, it's an OS functionality. Use an OS tool.