Hi ,
I have created a liferay cron scheduler and it is working fine.But when I add a '.sh' command to execute along with it then in that case only "receive" method(Scheduler class method) is executing, my script is not executing.Can someone help me with this?
Am I doing something wrong or liferay does not support '.sh' or '.pl' execution in <cron-trigger-value> ?
Here is my code and liferay-portlet.xml entry:
Java Code:
import com.liferay.portal.kernel.messaging.Message;
import com.liferay.portal.kernel.messaging.MessageListener;
import com.liferay.portal.kernel.messaging.MessageListenerException;
public class Schedular implements MessageListener {
int i = 1;
public void receive(Message arg0) throws MessageListenerException {
//Here is the buisness logic to be written as per your requirement
System.out.println("Scheduler has been started; "+ "value is: "+ i);
i++;
}
}
Liferay-portlet.xml entry:
<scheduler-entry>
<scheduler-event-listener-class>com.ys.schedule.Schedular</scheduler-event-listener-class>
<trigger>
<cron>
<cron-trigger-value>0 0/1 * 1/1 * ? * /Users/shashantp/Projects/testFolder/text1.sh</cron-trigger-value>
</cron>
</trigger>
</scheduler-entry>
Thanks & Regards,
Shashant
Please sign in to flag this as inappropriate.