Created
February 11, 2022 04:30
-
-
Save mavyfaby/84109df33a8e50c12c93c771ed6d31fa to your computer and use it in GitHub Desktop.
Deploy Attendance Management System project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
date=$(date '+%m-%d-%Y-%I:%M:%S%p') | |
if [ ! -d "/home/maverick/Mavy/wmdc/backups/attendance-${date}/" ]; then | |
mkdir /home/maverick/Mavy/wmdc/backups/attendance-${date}/ | |
fi | |
if [ "$(ls -A /var/lib/tomcat9/webapps/attendance)" ]; then | |
mv /var/lib/tomcat9/webapps/attendance/* /home/maverick/Mavy/wmdc/backups/attendance-${date}/ | |
fi | |
cp -r css fonts img js META-INF WEB-INF index.html logo.jpg robots.txt /var/lib/tomcat9/webapps/attendance/ | |
if [[ $1 == "-r" ]]; then | |
sudo service tomcat9 restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment