Data Backup and Recovery
Data Backup and Recovery
Hi there,
I'm currently setting up SnapCreator server on Linux.
Unfortunately there seems like no init script is provided with it.
My question is what daemon/command should I run when the machine starts to enable the snapcreator scheduler.
Regards.
Looks like you want to start the GUI.
Steps:
1) cd to scServer directory
2) execute ./snapcreator --profile setup
3) complete the setup
4) cd to gui folder under scServer
5) execute java -jar snapcreator.jar
6) Now you can access snapcreator GUI in a browser http://localhost:8080/ by using the username/pwd entered during profile setup.
Thanks,
Kapil
Here my script to start the snapcreator gui during server startup. I'm using RHEL, so I deleted the init configuration for SLES. If you are using SLES, delete the RHEL init configuration. I never checked the SLES configuration, but iit should be run. Maybe you have to change a little bit for other distributions.
Be careul to use another running environment than root. Most Jobs will run but at least the vSphere plugin needs root priviledges because it is using icmp ping to check the availability of the vSphere server.
#!/bin/sh
#
# snapcreator-gui This shell script takes care of starting and stopping
# snapcreator gui server.
#
# ---- DO NOT REMOVE !!! The following comments needed by RHEL ----
#
# chkconfig: 2345 95 5
# description: snapcreator framework gui server
# processname: snapcreator-gui
#
# ---- DO NOT REMOVE !!! The following comments needed by RHEL ----
# ---- DO NOT REMOVE !!! The following comments needed by SUSE ----
### BEGIN INIT INFO
# Provides: snapcreator-gui
# Required-Start: $network
# Should-Start: $all
# Required-Stop: $all
# Default-Start: 3 5
# Default-Stop: 0 1 2 3 5 6
# Description: snapcreator framework gui server
### END INIT INFO
# ---- DO NOT REMOVE !!! The above comments needed by SUSE --------
export SnapCreGUI=/opt/NetApp/snapcreator/scServer/gui
export SnapCreJAR=snapcreator.jar
export SnapCreLOG=/opt/NetApp/snapcreator/scServer/logs/snapcreator-javaserver.log
export SnapCrePORT=8085
#export SnapCreUSER=snapcrea
export SnapCreUSER=root
function usage()
{
echo "Call: $0 start|stop|restart|status"
exit 1
}
function is_running()
{
SnapCrePID=$(ps -ef | grep 'java -jar snapcreator.jar' | grep -v grep | awk ' { printf "%s ",$2 }')
echo "$SnapCrePID" | sed -e 's/ $//g'
}
function status_snapcreator()
{
if [ $(is_running) ]
then echo -e "snapcreator gui server is running with pid $(is_running)."
else echo -e "snapcreator gui server is not running."
fi
}
function start_snapcreator()
{
echo -e "start snapcreater gui server: \c"
if [ $(is_running) ]
then
echo -e "snapcreator gui server is running with pid $(is_running). Nothing to do."
else
if [ -f $SnapCreGUI/$SnapCreJAR ]
then
su - $SnapCreUSER -c "cd $SnapCreGUI; java -jar $SnapCreJAR -gui_port $SnapCrePORT >$SnapCreLOG 2>&1 &"
sleep 10
if [ $(is_running) ]
then
echo -e "running with pid $(is_running)"
else
echo -e "snapcreator gui server is not startable, see Logfile $SnapCreLOG"
exit 1
fi
else
echo -e "$SnapCreGUI/$SnapCreJAR missing"
exit 1
fi
fi
}
function stop_snapcreator()
{
echo -e "stop snapcreater gui server: \c"
if ! [ $(is_running) ]
then
echo -e "snapcreator gui server is not running. Nothing to do."
else
kill $(is_running)
sleep 10
if [ $(is_running) ]
then
echo "Killing java with -9"
kill -9 $(is_running)
else
echo "done"
fi
fi
rm -rf /tmp/Jetty_0_0_0_0_8085_snapcreator*
}
case "$1" in
start) start_snapcreator
;;
stop) stop_snapcreator
;;
restart) stop_snapcreator
sleep 5
start_snapcreator
;;
status) status_snapcreator
;;
*) echo -e "\nmissing or wrong parameter"
usage
;;
esac
exit 0
Regards
Volker
Hi Volker,
Thanks for contributing this. I added this to a github repository where all the Snap Creator source code is called SC-MISC. I hope this is ok? I put your name as author.
https://github.com/NetApp/SC-MISC/tree/main/scripts/start-scripts
If you are partner you can sign up for our developer community @ www.snapcreator.com. End customers still dont have hae access but we are working on adding this soon. In future if you have any other scripts or addons feel free to upload them to the SC-MISC repository in github.
Again thanks, this is really great!
Keith
I'm end customer, so I have no access, but it is no problem
regards Volker