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

Seperate from general cronjob #20

Closed
creecros opened this issue Feb 23, 2023 · 10 comments
Closed

Seperate from general cronjob #20

creecros opened this issue Feb 23, 2023 · 10 comments
Assignees

Comments

@creecros
Copy link
Owner

          @creecros  I recommend not to put the email polling through the general cron job instead to define a seperate cron job. 

Let me explain a problem I encounterd .

The general cron job also used to sent out reminders for tasks that are due , so we could set only daily schdule for it.

But for taks generation through email , should be somthing to be executed at least hourly.

So putting both jobs in same cron will flood up the email inbox if you have enabled the email notifications.

Originally posted by @isvfgs in #16 (comment)

@creecros
Copy link
Owner Author

At a quick glance, I have no idea how to make a separate cronjob run only 1 event, on a different schedule, much less a newely created event that has nothing to do with the daily crontjob event.

@alfredbuehler
Copy link
Collaborator

I have an idea. I have created a command, a compatible event, but I don't know hot to submit that event.

@alfredbuehler alfredbuehler self-assigned this Feb 23, 2023
@creecros
Copy link
Owner Author

i probably do not know, but if you can show me where you are going, i might be able to think about it more.

@alfredbuehler
Copy link
Collaborator

We have now our own cron job. You can simply run

./cli mailmagik:fetchmail

from your crontab, beside your usual cronjob command.
This new command invokes mail fetching only, but doesn't trigger any overdue notifications. If you want to switch to the new event, you have to recreate any existing automatic actions for mail fetching. Please note, that using the "old" event is still possible.

In case you have too many actions to fix:

UPDATE actions SET event_name = 'mailmagik.fetchmail' WHERE event_name = 'task.cronjob.daily'
AND action_name LIKE '%ConvertEmailTo%'

Of course, fully at your own risk.

@creecros
Copy link
Owner Author

wow look at that, good stuff. goes way over my head!

@alfredbuehler
Copy link
Collaborator

Yeah, learning about the event system was not easy.

@isvfgs
Copy link

isvfgs commented Feb 24, 2023

Cool.. Thanks for this update

./cli mailmagik:fetchmail this is what I was looking for..

hoping this update will solve the issue. Will test out and will report if I find any issues.

@creecros
Copy link
Owner Author

creecros commented Feb 24, 2023

i just tested and it works flawlessly. this is my new crontab file:

0 8 * * * cd /var/www/app && ./cli cronjob >/dev/null 2>&1
* * * * * cd /var/www/app && ./cli mailmagik:fetchmail

@isvfgs
Copy link

isvfgs commented Feb 24, 2023

Does this resolve the previous problem of at least a task in a project required to initate the email fetch ? if so the readme can be updated with the same

@creecros
Copy link
Owner Author

it appears so!

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

No branches or pull requests

3 participants