Currently, I have to manually start/stop my applications with the scripts below. I didn't write the scripts. I want to write a script to automate the steps and be able to schedule it. I have not written a script before and looking for some guideance.
The manual scripts/commands used to shutdown are:
log into server as root
SU - APPUSER
cd /Installed/Apps
./downapp
./downtomcat.sh
./downsqlanywhere.sh
SU - root
I am prompted for the password
Shutdown -Fr
The applications startup when the server boots however, if I want to manually start the scripts are used:
SU - APPUSER
cd /Installed/Apps
./startsqlanywhere.sh
./starttomcat.sh
./startapp
This is how I think the Shutdown Script for Application server would look based on my research. The script would be scheduled and I assume it would run with root authority.
su appuser -c /Installed/Apps/downapp
su appuser -c /Installed/Apps/downtomcat.sh
su appuser -c /Installe/Apps/downsqlanywhere.sh
Shutdown -Fr
If I want the script in the scheduler, are there any specific attributes that need to be set?
When running in the scheduler, is it assumed that root is the user?
Is there something missing from the script or is there a better way to create it?
Thanks
------------------------------
Michael Garczynski
Director - SAP Architecture
DAP Products
------------------------------