linux - Shell script cronjob -


i need shell script run 2 .sh files in directory: /opt/tomcat-latest/bin

#!/bin/sh  cd /opt/tomcat-latest/bin ./shutdown.sh ./startup.sh 

would code achieve goal? if how make on cron job runs every 2 hours? have linux centos vps , directadmin admin panel.

i think easiest solution run directly commands full path cron, instead of using sh script.

something in crontab work :

* */2 * * * /opt/tomcat-latest/bin/shutdown.sh && /opt/tomcat-latest/bin/startup.sh 

that run every 2 hours can edit crontab crontab -e , check crontab syntax here : https://fr.wikipedia.org/wiki/crontab


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -