cron has to run after some time of node publishing.I tried like this

 function custom_module_cron{
//($updated = node published time)
if(date("Y/m/d H:i:s") == date("Y/m/d H:i:s",$updated+60)){
//code here

but its not running automatically. Can anybody help ?

  • Can you elaborate on what you need to do 60 seconds after a node is published? cron is likely not the right solution to your actual problem.
    – mpdonadio
    Commented Dec 20, 2016 at 1:30

1 Answer 1


have you managed your cron configuration, if no then go to /admin/config/system/cron and set your cron settings to run on that interval of time.

Hope it solves your issue.

  • Thanks for your reply .But my requirement is not particular interval of time .after 60 seconds of every node publishing.
    – sri
    Commented Dec 19, 2016 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.