Skip to main content
selvaganesh
Level 5
Oct 16, 2015 2:27 AM UTC
Solved

Execute shell script after dispatcher flushes the cache

I need to do some activities immediately after the dispatcher flushes the cache .  The activity can be done by a shell script. Is it possible to fire a script as soon as the dispatcher flushes the cache ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:27 AM UTC

3 replies

Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:27 AM UTC
Oct 16, 2015 2:27 AM UTC

You can monitor the .stat file for change in timestamp using incrond . If the timestamp updates, your shell script can be run then.

You can check this here http://linux.die.net/man/8/incrond

Translate
Level 2
Jun 21, 2016 1:46 AM UTC

Sham HC wrote...

Make use of invalidateHandler. Details & example at

http://docs.adobe.com/docs/en/dispatcher/disp-config.html#Using%20custom%20invalidation%20scripts

 

I have /invalidateHandler mapped to /var/www/cache/dispconfigs/disp.sh in publish-farm.any under /cache section

Now,

curl -H "CQ-Action: Delete" -H "CQ-Handle: /content" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" http://branda.com/invalidateHandler works fine and see the cache being deleted, but the one below does not work (trying to execute a custom script).

curl http://branda.com/invalidateHandler?parameter1&parameter2&parameter3 does not seem to work either. I get "The requested URL /invalidateHandler was not found on this server."  I guess the syntax is wrong. A sample of how to use curl with invalidateHandler would be helpful

Translate