• Hey Guest, we're evolving the future of TeaSpeak.
    You're invited to join the discussion here!

Release Script to automatically create snapshots of virtual servers.

Vafin

TeaFanatic
This script I found on Github and slightly remade it under TeaSpeak. Simply add the server query details you wish to use at the bottom of the file, or multiple for multiple phyiscal servers, And call the script. A folder will be created in the execution directory, named with the current date, which will contain .txt files with the server snapshots. These snapshot files are named with the Server name (Most of it), and the port, along with the date and time for sorting purposes. These can either be restored using a Telnet client, or used with YaTqA. To automate the process, add the script to Cron.

Last version: https://forum.teaspeak.de/index.php?threads/script-to-automatically-create-snapshots-of-virtual-servers.1537/post-17862

Link to the source https://github.com/jh502/TeamSnap
 

Attachments

Last edited:

WolverinDEV

TeaSpeak Team
Staff member
Administrator
Could you may explain it a littlebit more detailed with a few command line examples to improve the understanding :)
 

Matin_Dark

New member
That seems cool but the problem is about hard to understand that could you explain about setup or make some video as a tutorial
 

Vafin

TeaFanatic
That seems cool but the problem is about hard to understand that could you explain about setup or make some video as a tutorial
You need to open the script in a text editor and edit the line (located at the end) substituting your server data.
Code:
SovereignTs3 = PhysicalServer("TS NAME HERE","IP HERE","SQ PORT HERE","SQ USER HERE - Ensure you have the relevant permissions","SQ PASS HERE")
Then put the script in any folder on the server and run in the terminal command (first go to the desired folder) python teasnap.ру
To automate the process, add the script to Cron
 

REDOSS

TeaSpeak Team
Staff member
TeaTeam
It would be nice to add the ability to make backup copies of the icons, since after restoring the server they will also be needed and it would be nice to upload the backups to the vault.

For example, Yandex or Google Dick would be generally great.
 

Vafin

TeaFanatic
It would be nice to add the ability to make backup copies of the icons, since after restoring the server they will also be needed and it would be nice to upload the backups to the vault.

For example, Yandex or Google Dick would be generally great.
I don't know python well enough to program such complex things))). Just I was looking for a solution for myself and I found it))) If you do I will be very grateful to you)))
 

MadD0g

Member
Good evening everyone,

I myself create a script that saves the entire Teaspeak folder and transforms it into a TAR archive. I also do a cron job so that the script starts every 12 hours. Attached is the script with comments translated into German and English.

For the cron job :
Bash:
0 */12 * * * /home/teaspeak1sauvegarde/backup.sh


P.S: Remember to change the paths and make the script usable by doing
Bash:
chmod +x backup.sh
 

Attachments

Vafin

TeaFanatic
Good evening everyone,

I myself create a script that saves the entire Teaspeak folder and transforms it into a TAR archive. I also do a cron job so that the script starts every 12 hours. Attached is the script with comments translated into German and English.

For the cron job :
Bash:
0 */12 * * * /home/teaspeak1sauvegarde/backup.sh


P.S: Remember to change the paths and make the script usable by doing
Bash:
chmod +x backup.sh
If you are working with a large number of virtual servers then your script is not very convenient to restore any separate virtual server.
 

MadD0g

Member
If you are working with a large number of virtual servers then your script is not very convenient to restore any separate virtual server.

That's right, you're right but I prefer to work this way in order to have a complete record of Teaspeak. And to restore a server I use YATQA
 

Matin_Dark

New member
You need to open the script in a text editor and edit the line (located at the end) substituting your server data.
Code:
SovereignTs3 = PhysicalServer("TS NAME HERE","IP HERE","SQ PORT HERE","SQ USER HERE - Ensure you have the relevant permissions","SQ PASS HERE")
Then put the script in any folder on the server and run in the terminal command (first go to the desired folder) python teasnap.ру
To automate the process, add the script to Cron
thanks for the help, but is there any way to create backups from multiple servers and if there is could you give example to me?
 

Vafin

TeaFanatic
thanks for the help, but is there any way to create backups from multiple servers and if there is could you give example to me?
Yes it can be done, but the folder with the results of snapshots of other servers will be located inside the folder of the first server, which is not good.
Code:
SovereignTs3 = PhysicalServer("TS1 NAME HERE","IP HERE","SQ PORT HERE","SQ USER HERE - Ensure you have the relevant permissions","SQ PASS HERE")
SovereignTs3.GetActiveServers()
SovereignTs3.BackupServers()
SovereignTs3.writeBackups()

SovereignTs3 = PhysicalServer("TS2 NAME HERE","IP HERE","SQ PORT HERE","SQ USER HERE - Ensure you have the relevant permissions","SQ PASS HERE")
SovereignTs3.GetActiveServers()
SovereignTs3.BackupServers()
SovereignTs3.writeBackups()

SovereignTs3 = PhysicalServer("TS3 NAME HERE","IP HERE","SQ PORT HERE","SQ USER HERE - Ensure you have the relevant permissions","SQ PASS HERE")
SovereignTs3.GetActiveServers()
SovereignTs3.BackupServers()
SovereignTs3.writeBackups()
 

Vafin

TeaFanatic
I updated the scripts to the latest server versions.
Script teasnap.py designed for creating snapshots of TeaSpeak servers.
Script ts3snap.py designed for creating snapshots of TS3 servers.
 

Attachments

xDyego

Well-known member
Hello @Vafin, your script worked very well for TeaSpeak, but it gave TS3 an error, the error seems to occur when there is a server with a "stopped" status. Would you know how to solve this problem for TS3?
 

Vafin

TeaFanatic
Hello @Vafin, your script worked very well for TeaSpeak, but it gave TS3 an error, the error seems to occur when there is a server with a "stopped" status. Would you know how to solve this problem for TS3?
Unfortunately not. I think it depends on the TS3 developers.
 

REDOSS

TeaSpeak Team
Staff member
TeaTeam
Hello @Vafin, your script worked very well for TeaSpeak, but it gave TS3 an error, the error seems to occur when there is a server with a "stopped" status. Would you know how to solve this problem for TS3?
You need to start a virtual server so that the server status becomes "online virtual", and only then can you make a backup copy of this server without starting it.

P:S. TS3 has three server statuses: online, offline, online virtual
 

xDyego

Well-known member
Yes, when all servers are in "online" status, the script works perfectly, but when the status is "stopped", the error occurs.
 

REDOSS

TeaSpeak Team
Staff member
TeaTeam
I will check. Maybe I can make the script skip the shutdown servers to eliminate the error ..
Yes, checking will help :) but if you need to make backups of disabled servers, you can enable the server virtually and make a copy, as I said above)) I encountered this when writing the backup functionality in my control panel.