Raised This Month: $32 Target: $400
 8% 

Need script for linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 05-22-2019 , 09:13   Need script for linux
Reply With Quote #1

Hello,
I'm very noob on linux, but i need a scrit to do it every day at 5a.m


PHP Code:
cd .. /home/csgoserver
ls
./csgoserver update

5min after 
reboot

login 
csgoserver
pw 

And if you can tell me how i can make this script and how i can execute, because i have 10 servers and impossible to fix the error 100 apt-get update. I need to use lgsm every time when cs go updates.


Thanks !
__________________
IDEAS-GAMING.COM SERVERS ON CSGO :

- HIDE AND SEEK - SUPERHEROES
- BUNNY HOP
- KZ / CLIMB

---------------------------------------------------------------------
My steam link
Donate !
vegeta1241 is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 05-22-2019 , 11:25   Re: Need script for linux
Reply With Quote #2

Thats example cronjob for LinuxGSM https://linuxgsm.com/lgsm/csgoserver/ add this to root cronjob (open with crontab -e) Make sure you don't skip any symbols that is written in there modify mycsgoserver to your username. User cronjobs keeps bricking for me for some reason.
Quote:
# Update
*/30 * * * * su - mycsgoserver -c '/home/mycsgoserver/csgoserver update' > /dev/null 2>&1
# Monitor
*/3 * * * * su - mycsgoserver -c '/home/mycsgoserver/csgoserver monitor' > /dev/null 2>&1
# Update LinuxGSM on saturdays night
0 0 * * 0 su - mycsgoserver -c '/home/mycsgoserver/csgoserver update-functions' > /dev/null 2>&1
# Force update every day
4 6 * * * su - mycsgoserver -c '/home/mycsgoserver/csgoserver force-update' > /dev/null 2>&1
# First attempt to update SM/MM
1 5 * * * su - mycsgoserver -c '/home/mycsgoserver/update_sm.sh' > /dev/null 2>&1
# Second attempt to update SM/MM
1 7 * * * su - mycsgoserver -c '/home/mycsgoserver/update_sm.sh' > /dev/null 2>&1
update_sm.sh script
Quote:
#!/bin/bash
set -ev
mkdir -p ~/tmp/
cd ~/tmp/
echo -e "Download and extract metamod"
wget "https://www.sourcemm.net/latest.php?version=1.10&os=linux" -O metamod.tar.gz
tar -xzf metamod.tar.gz
rm metamod.tar.gz
cp -R addons/metamod/bin ../serverfiles/csgo/addons/metamod/
echo -e "Download and extract sourcemod"
wget "http://www.sourcemod.net/latest.php?version=1.9&os=linux" -O sourcemod.tar.gz
tar -xzf sourcemod.tar.gz
rm sourcemod.tar.gz
cp -R addons/sourcemod/bin ../serverfiles/csgo/addons/sourcemod/
cp -R addons/sourcemod/extensions ../serverfiles/csgo/addons/sourcemod/
cp -R addons/sourcemod/gamedata ../serverfiles/csgo/addons/sourcemod/
cp -R addons/sourcemod/translations ../serverfiles/csgo/addons/sourcemod/
cd ~
rm -rf tmp
__________________

Last edited by iGANGNAM; 05-22-2019 at 11:30.
iGANGNAM is offline
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 05-22-2019 , 19:21   Re: Need script for linux
Reply With Quote #3

Thank you very much !!! Updating meta mod sourcemod will reset database admin si Oke etc ??
__________________
IDEAS-GAMING.COM SERVERS ON CSGO :

- HIDE AND SEEK - SUPERHEROES
- BUNNY HOP
- KZ / CLIMB

---------------------------------------------------------------------
My steam link
Donate !
vegeta1241 is offline
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 05-24-2019 , 05:45   Re: Need script for linux
Reply With Quote #4

I have did all but doesn't work ...

https://www.noelshack.com/2019-21-5-...reenshot-1.png
https://www.noelshack.com/2019-21-5-...reenshot-2.png
https://www.noelshack.com/2019-21-5-...reenshot-3.png

My startserver.sh are in home/csgoserver/serverfiles
My update_sm.sh are in home/csgoserver

Please help me all is good ?
__________________
IDEAS-GAMING.COM SERVERS ON CSGO :

- HIDE AND SEEK - SUPERHEROES
- BUNNY HOP
- KZ / CLIMB

---------------------------------------------------------------------
My steam link
Donate !
vegeta1241 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode