1. Following script can be used
pswd=`pass OSGI-admin`
echo -e `date`
echo -e "start script"
echo -e "stop bundle"
curl -u admin:"$pswd" http://OSGI-IP:Port/system/console/bundles/bundle.jsp -F action=stop
echo -e ""
echo -e "Waiting for 3 seconds"
sleep 3
echo -e "start bundle"
curl -u admin:"$pswd" http://OSGI-IP:Port/system/console/bundles/bundle.jsp -F action=start
echo -e ""
echo -e `date`
echo -e ""
echo -e ""
echo -e ""
2. Add above script to crontab
crontab -e
Add following line to run every 4 hours:
0 */4 * * * /home/user/bundle-script.sh >> /home/user/history-bundle-script.log
In history-bundle-script.log you shall get logged all events.
No comments:
Post a Comment