docker-misp icon indicating copy to clipboard operation
docker-misp copied to clipboard

Customizing cronjobs tasks

Open clopmz opened this issue 3 years ago • 4 comments

Good morning,

My MISP environment is working perfect in my lab. Many thanks @coolacid for your help. MISP is currently installed on a virtual machine that is not up 24x7. Because of this, I see that cron jobs to update feeds and various MISP components are executed in the wee hours of the morning.

Is it possible to customize these cron jobs to be executed at different hours?

clopmz avatar Nov 22 '21 07:11 clopmz

Just volume mount a different crontab in /etc/cron.d/

coolacid avatar Nov 22 '21 15:11 coolacid

Hi @coolacid

I have added the following entry in docker-compose.yml:

  • "./crontabs/:/etc/cron.d/"

With the following file:

crontabs/update_misp

20 */2 * * * www-data /var/www/MISP/app/Console/cake Server cacheFeed 1 all >/tmp/cronlog 2>/tmp/cronlog 40 */2 * * * www-data /var/www/MISP/app/Console/cake Server fetchFeed 1 all >/tmp/cronlog 2>/tmp/cronlog 00 9 * * * www-data /var/www/MISP/app/Console/cake Admin updateGalaxies >/tmp/cronlog 2>/tmp/cronlog 10 9 * * * www-data /var/www/MISP/app/Console/cake Admin updateTaxonomies >/tmp/cronlog 2>/tmp/cronlog 20 9 * * * www-data /var/www/MISP/app/Console/cake Admin updateWarningLists >/tmp/cronlog 2>/tmp/cronlog 30 9 * * * www-data /var/www/MISP/app/Console/cake Admin updateNoticeLists >/tmp/cronlog 2>/tmp/cronlog 45 9 * * * www-data /var/www/MISP/app/Console/cake Admin updateObjectTemplates >/tmp/cronlog 2>/tmp/cronlog

But it doesn't seem to work ...

clopmz avatar Nov 23 '21 09:11 clopmz

Is there anything in the /tmp/cronlog file? Can you try putting in a simple echo to file and see if that works?

coolacid avatar Jan 05 '22 14:01 coolacid

Hi @coolacid

/tmp/cronlog is empty but I don't know how but it seems is working after updating docker images to v2.4.152...

clopmz avatar Jan 11 '22 08:01 clopmz