Skip to content

Instantly share code, notes, and snippets.

@fabbrito
Last active November 5, 2022 19:23
Show Gist options
  • Save fabbrito/1504687fe51250a8b4cd9c4699b22e13 to your computer and use it in GitHub Desktop.
Save fabbrito/1504687fe51250a8b4cd9c4699b22e13 to your computer and use it in GitHub Desktop.
TS3: local backup of the server (using pullsnapshot.sh)
#!/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
@fabbrito
Copy link
Author

fabbrito commented Nov 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment