Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #set +x
- killserver=0
- notifydebug=0
- maintaince=0
- notneededoutput="/dev/null" #/home/steam/arma3 #armataskname
- backupdir="backups"
- logdir="logs"
- armalog1="armac.log"
- armalog2="armar.log"
- time=`date +%b-%d-%y`
- ##########################################################################################################################################################
- #pushb () {
- # i=$1
- # #pushb $i > $notneededoutput
- # return 0
- #}
- #if [ $maintaince = "1" ]
- # then
- # echo "MAINTAINCE MODE"
- # exit 1
- #fi
- #if [ $killserver = "1" ]
- # then
- # pkill arma3server
- #fi
- #if [ $notifydebug = "1" ]
- # then
- # #pushb "test"
- #fi
- if pgrep arma3server > $notneededoutput #if server is started then
- then
- echo "" > $notneededoutput
- else
- echo "===========$(date)==========="
- #find . -wholename "*.log" -size +1000k -delete
- ##pushb "Server not started" > $notneededoutput
- echo =============================
- echo Server NOT started
- H=$(date +%H)
- if (( 5 <= 10#$H && 10#$H < 9 ))
- then
- echo Time is 5 to 9
- echo Starting Backup
- if [ -f /home/steam/backups/arma3backup$time.tar.gz ];
- then
- echo "There is an Backup already"
- else
- echo "No Backup yet"
- tar -cvpzf /home/steam/backups/arma3backup$time.tar.gz ../arma3
- #pushb "Making Backup" > $notneededoutput
- fi
- echo End Of Backup
- echo Deleting Old Backups?
- find /home/steam/backups -mindepth 1 -mtime +7 -delete
- else
- echo Just Restarting
- ##pushb "Just Restarting" > $notneededoutput
- fi
- ./arma3server -par=arma3server_startup_parameters.txt > $logdir/$armalog1 2> $logdir/$armalog2 &
- if pgrep arma3server > $notneededoutput
- then
- #pushb "Server started" > $notneededoutput
- echo "Server started"
- else
- #pushb "Server could not start" > $notneededoutput
- echo "" > $notneededoutput
- fi
- #nice -n -19
- echo =============================
- fi
- ##########################################################################################################################################################
Add Comment
Please, Sign In to add comment