Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Execute shell script after dispatcher flushes the cache

selvaganesh
Level 6
Level 6

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 ?

1 Accepted Solution
Sham_HC
Correct answer by
Level 10
Level 10
3 Replies
ahmedI
Level 3
Level 3

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

Sham_HC
Correct answer by
Level 10
Level 10
SKK
Level 2
Level 2

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