Skip to content

Conversation

@romellem
Copy link
Contributor

The main point of this is to provide documentation
when you get the following error in the cron logs
after trying to run a gulp task:

/usr/bin/env: node: No such file or directory

Resolves #2033.

The main point of this is to provide documentation
when you get the following error in the cron logs:

> /usr/bin/env: node: No such file or directory
@romellem romellem changed the title Creates recipe for running gulp via cron task docs(recipe): Running gulp via cron task Oct 31, 2017
Typically, within a cron job, you want to run any binary using absolute paths,
so an initial approach to running `gulp build` every minute might look like:

* * * * * cd /your/dir/to/run/in && /usr/local/bin/gulp build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the * * * * *?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that is a cron thing. Before the actual command you want to run, you have to specify the schedule for the command. That is, how often a command should run:

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                       7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * *  command to execute

Per What does * * * * * (five asterisks) in a cron file mean?,

Every minute of every day of every week of every month, that command runs.

I figured I would use that rather some some arbitrary "run once a day at midnight" or something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Thanks

@phated phated merged commit 2c6d551 into gulpjs:master Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants