Last active
November 5, 2022 19:23
-
-
Save fabbrito/1504687fe51250a8b4cd9c4699b22e13 to your computer and use it in GitHub Desktop.
TS3: local backup of the server (using pullsnapshot.sh)
This file contains 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 | |
FILE=snapshot_`date +%Y_%m_%d`.txt | |
if [[ -f "$FILE" ]]; then | |
echo "The $FILE already exists!" | |
exit | |
fi | |
LOGIN=`grep -oP 'loginname=..\K[[:alnum:]]+' ts3_server.txt` | |
PASSWD=`grep -oP 'password=..\K([[:alnum:]]|\+){8}' ts3_server.txt` | |
./pullsnapshot.sh $LOGIN $PASSWD localhost 10011 $FILE 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ts3_server.txt comes from the logs when creating the TS3 server.
The regex will match the login and password from the line:
loginname= "username", password= "AbCd+EfG"
in ts3_server.txt