S
S
Sergey2015-11-18 15:14:41
linux
Sergey, 2015-11-18 15:14:41

How to execute mongodb command from cron?

It is necessary to perform a couple of times a day to clear the cache from under the crown to delete the collection of documents.
I can configure cron, how to execute the order of these actions from the console with one command?

sudo mongo
use dbname
dbname.cache.drop()
exit

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
borodka_lenina, 2015-11-18
@butteff

mongo dbname --eval "dbname.cache.drop()"

A
Andrew, 2015-11-18
@R0dger

stackoverflow.com/questions/4837673/how-to-execute...
look at this.. might it work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question