Discussion:
[mongodb-user] Task Scheduling / Crons
Sean Dezoysa
2018-06-21 16:07:53 UTC
Permalink
Hey guys,

Is there any way to schedule tasks or crons to fire server functions at
specific times? I know you normally need root access to crontab, just
curious if MongoDB Cloud (Atlas / Stitch) has a way, thanks.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/ec9d45b2-0cad-4900-b76f-27b69dacc715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Stephen Steneker' via mongodb-user
2018-06-25 06:53:21 UTC
Permalink
Post by Sean Dezoysa
Is there any way to schedule tasks or crons to fire server functions at
specific times?
Hi Sean,

MongoDB does not currently provide a task scheduling service via the
MongoDB server or any of the current Cloud services. Scheduled tasks are
normally an O/S or application feature.

I know you normally need root access to crontab


You only need root access if you are editing the crontab for root or
another user. Each user can have their own crontab, but the tasks will run
with that user account's permissions and ulimits.

just curious if MongoDB Cloud (Atlas / Stitch) has a way, thanks.


This isn't specific to MongoDB, but a common approach would be to set up an
endpoint in your application that implements the functionality you want to
schedule and then use an external crontab to trigger that endpoint. For
example, you could set up a personal crontab and use curl or wget to
trigger the endpoint according to a schedule.

An important consideration to account for in your endpoint implementation
is whether it should allow the same task to have multiple instances running
currently (for example, if a previously scheduled task hasn't finished
running or the endpoint gets fetched more than once in short interval).

If you are using MongoDB Stitch, there is the option of configuring triggers
<https://docs.mongodb.com/stitch/mongodb/triggers/> based on data change
events, but you would still need an external process to insert data with
the appropriate timing for your scheduled tasks.

Regards,
Stennie
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/0f7a54f1-69dc-4e0d-95db-d22848e99741%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...