Raised This Month: $51 Target: $400
 12% 

Can Linux CSGO Server Execute a Bash File


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jacobdu215
Junior Member
Join Date: Aug 2017
Old 08-01-2017 , 21:35   Can Linux CSGO Server Execute a Bash File
Reply With Quote #1

Basically I have a server where I run pugs for 10mans. It records demos and just saves them in the base directory of the csgo server. I made a bash file that can upload that to my storage server and then delete it after. Is there any way a csgo server can run a .sh or bash file after a csgo match is complete maybe using a cfg?
jacobdu215 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-02-2017 , 01:18   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #2

You would need a SM or MM:S extension to directly run a shell script. You could do something more indirect such as having a shell script sit and watch the server logs (for a map change or whatever) and do something as a result. Or, it could wait for a SM script to write a file with an expected name, then it could erase the file, do its thing, and wait again.
Fyren is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 08-02-2017 , 03:22   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #3

This is an ugly solution, but it works.

Code:
* 0,12,16,20,22 * * * bzip2 /home/pugs/serverfiles/csgo/*.dem && 
	rsync -v -z -e ssh /home/pugs/serverfiles/csgo/*.dem.bz2 shavit@website:/home/shavit/www/demos/ &&
	rm /home/pugs/serverfiles/csgo/*.dem.bz2 && 
	curl -X DELETE \"https://api.cloudflare.com/client/v4/zones/XXXXXXXXXXXX/purge_cache\" -H \"X-Auth-Email: [email protected]\" -H \"X-Auth-Key: XXXXXXXXXXXX\" -H \"Content-Type: application/json\" --data \'{\"files\":[\"https://my.websi.te/demos\", \"https://my.websi.te/demos/\"]}\' >/dev/null 2>&1
That's what I do to generate something like this:
__________________
retired
shavit is offline
jacobdu215
Junior Member
Join Date: Aug 2017
Old 08-03-2017 , 20:55   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #4

Quote:
Originally Posted by shavit View Post
This is an ugly solution, but it works.

Code:
* 0,12,16,20,22 * * * bzip2 /home/pugs/serverfiles/csgo/*.dem && 
	rsync -v -z -e ssh /home/pugs/serverfiles/csgo/*.dem.bz2 shavit@website:/home/shavit/www/demos/ &&
	rm /home/pugs/serverfiles/csgo/*.dem.bz2 && 
	curl -X DELETE \"https://api.cloudflare.com/client/v4/zones/XXXXXXXXXXXX/purge_cache\" -H \"X-Auth-Email: [email protected]\" -H \"X-Auth-Key: XXXXXXXXXXXX\" -H \"Content-Type: application/json\" --data \'{\"files\":[\"https://my.websi.te/demos\", \"https://my.websi.te/demos/\"]}\' >/dev/null 2>&1
That's what I do to generate something like this:


Is that supposed to run 24*7?
jacobdu215 is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 08-04-2017 , 15:01   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #5

Quote:
Originally Posted by jacobdu215 View Post
Is that supposed to run 24*7?
It's a cronjob, it runs every once in a while.
__________________
retired
shavit is offline
jacobdu215
Junior Member
Join Date: Aug 2017
Old 08-07-2017 , 19:58   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #6

Quote:
Originally Posted by shavit View Post
It's a cronjob, it runs every once in a while.
So basically theres no way I can get a bash file to run after a match ends? How hard would it be to make a plugin like this then?
jacobdu215 is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 08-08-2017 , 07:53   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #7

You can, https://forums.alliedmods.net/showthread.php?t=146019
__________________


Max-Play.pl - the best polish servers
CamerDisco is offline
jacobdu215
Junior Member
Join Date: Aug 2017
Old 08-09-2017 , 17:44   Re: Can Linux CSGO Server Execute a Bash File
Reply With Quote #8

Quote:
Originally Posted by CamerDisco View Post
No idea how to use an extension but Ill look into it
jacobdu215 is offline
Reply



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 04:38.


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