Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak multisite cron job to fix standard output #1458

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Tweak multisite cron job to fix standard output #1458

merged 1 commit into from
Dec 15, 2022

Conversation

E-VANCE
Copy link
Contributor

@E-VANCE E-VANCE commented Dec 15, 2022

With our multisite-setup I have been seeing hourly attempts within our Mailgun-logs to send out an email notification regarding the cron job that is set up there:

cd {{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }} && wp site list --field=url | xargs -n1 -I \\% wp --url=\\% cron event run --due-now > /dev/null 2>&1

Seeing that > /dev/null 2>&1 is appended, this shouldn't be happening...

Wrapping the two joint commands in brackets ((wp site list --field=url | xargs -n1 -I \\% wp --url=\\% cron event run --due-now) > /dev/null 2>&1) fixes the standard output and I am not seeing any attempts to send out email notifications in our Mailgun logs any more.

Have successfully tested running the new command in full on our server and it performs as expected.

@swalkinshaw
Copy link
Member

I couldn't really replicate this locally with different commands, but it makes sense in theory and there shouldn't be any downside regardless 👍

@swalkinshaw
Copy link
Member

@E-VANCE could you rebase to get rid of the other two commits please?

@E-VANCE
Copy link
Contributor Author

E-VANCE commented Dec 15, 2022

@swalkinshaw Sorry for the overhead / mess... Should be clean now.

@swalkinshaw swalkinshaw merged commit 8038b1a into roots:master Dec 15, 2022
paulbrzeski pushed a commit to paulbrzeski/trellis that referenced this pull request Mar 3, 2023
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