docs(recipe): Running gulp via cron task#2034
Merged
phated merged 2 commits intogulpjs:masterfrom Nov 3, 2017
Merged
Conversation
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
phated
reviewed
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 |
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Resolves #2033.