Draft
Conversation
|
Preview of modified Markdown: |
adriendupuis
commented
Mar 7, 2025
| ``` | ||
| rm ezp_cron.txt | ||
| rm ibexa_cron.txt | ||
| ``` |
Contributor
Author
There was a problem hiding this comment.
The whole section could be rewrite. 2 suggestions:
- With a temporary file containing the whole crontab:
For example, to check links every week, the cronjob line looks like the following
where `[path-to-ibexa]` should be replaced with actual path to the installation directory:
```
0 0 * * 0 cd [path-to-ibexa]; php bin/console ibexa:check-urls --quiet --env=prod
```
Append the new cronjob line to user's crontab without destroying existing cronjob lines.
Assuming that the web server user data is `www-data`, it can be added this way:
```bash
crontab -u www-data -l > ibexa_cron.txt # backup existing cronjob list
echo '0 0 * * 0 cd [path-to-ibexa]; php bin/console ibexa:check-urls --quiet --env=prod' >> ibexa_cron.txt # Add cronjob line
crontab -u www-data - ibexa_cron.txt # replace with new cronjob list
rm ibexa_cron.txt # remove temporary file
```
- With a one liner
For example, to check links every week, the cronjob line looks like the following
where `[path-to-ibexa]` should be replaced with actual path to the installation directory:
```
0 0 * * 0 cd [path-to-ibexa]; php bin/console ibexa:check-urls --quiet --env=prod
```
Append the new cronjob line to user's crontab without destroying existing cronjob lines.
Assuming that the web server user data is `www-data`, it can be added this way:
```bash
(crontab -u www-data -l; echo '0 0 * * 0 cd [path-to-ibexa]; php bin/console ibexa:check-urls --quiet --env=prod') | crontab -u www-data -
```
Contributor
Author
There was a problem hiding this comment.
Side note: recent_activity.md doesn't explain how to add its cron job line
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.
Checklist