Jump to content

Configurable backup and restore scripts


LFA

Recommended Posts

  • 2 years later...
7 hours ago, LFA said:

I uploaded an updated version of the backup/restore script that uploads the backup files to FTP. https://help.tcadmin.com/Backup_%26_Restore_Scripts_with_FTP_Support

This is quite cool. Is there no way for restores to pull from FTP regardless of that local cache

If i backup and then re-install a server the local zip cache gets deleted and as a result i cant pull that backup that still exists in FTP the comobox is empty

The only thing i can think of is to point this to a different location outside the ThisService.RootDirectory
 

# Specify where backups are saved.
# Default location is a folder named Backups in the game server's root.
BACKUP_LOCATION = Path.Combine(ThisService.RootDirectory, "Backups")

 

Link to comment
Share on other sites

The updated script that uses FTP does not store a local copy of the file. Each backup file in ftp has a local file with size 0. This is just to know what we have in FTP and it can be shown in the list when restoring.

The Backups folder needs to be inside the game server root. It doesn't use up any space. You need to hide the Backups folder using the game's file system permissions so the user doesn't delete anything.

Link to comment
Share on other sites

The updated script that uses FTP does not store a local copy of the file. Each backup file in ftp has a local file with size 0. This is just to know what we have in FTP and it can be shown in the list when restoring.
The Backups folder needs to be inside the game server root. It doesn't use up any space. You need to hide the Backups folder using the game's file system permissions so the user doesn't delete anything.
Yes i have set it up all like that it makes the 0kb zip in the root and uploads to ftp. Problem is if you reinstall the server that 0 kb zip file deletes so if you go back into the restore script icon after a reinstall the combo box is empty.

Sent from my SNE-LX1 using Tapatalk

Link to comment
Share on other sites

6 hours ago, LFA said:

You can add a custom script for the before reinstall to move it out of root and after reinstall to move it back in.

I'll add the scripts later.

@LFAI did make a download section for your scripts that only you can upload too... https://community.tcadmin.com/files/category/4-tcadmin-panels-scripts/
It'll automatically make a post inside the new section of the forums called "TCAdmin Panel Scripts"  that only you can make new post's in but everyone can reply to them :) feel free to give it a whirl.

Link to comment
Share on other sites

On 2/27/2020 at 9:09 PM, LFA said:

You can add a custom script for the before reinstall to move it out of root and after reinstall to move it back in.

I'll add the scripts later.

Just following up when will this be updated to move the zips out of root

if its not updating ill just do a batch script.

Thanks

Link to comment
Share on other sites

  • 1 year later...

Awesome script! This works great. I had one question on this.

So I'm looking to organize a little more and relocate the zip to a different drive.  I got it working going to another drive and all but I'm stuck on the Path.Combine section in what I'm trying to do.

Below I made a variable called "HDrive" and the where that variable is pointing. This entire thing works here below.

ThisService.Variables["HDrive"] = "H:\TCADMINBackups\Users"
BACKUP_LOCATION = Path.Combine(ThisService.Variables["HDrive"], )

Now what I'm trying to do is organize it by user and serviceid. This is what I tried doing but it seems that when I use the code below the first variable works but then the rest just makes folders names called TheService.UserId and the ServiceId one

ThisService.Variables["HDrive"] = "H:\TCADMINBackups\Users"
BACKUP_LOCATION = Path.Combine(ThisService.Variables["HDrive"], ThisService.UserId, ThisService.ServiceId)

I tried putting them in quotes and parenthesis also but I'm sure it just comes down to me not knowing coding much. Is there more to this that I have to do to maybe make that work? I was looking for an output like this: H:\TCADMINBackups\Users\<UserId>\<ServiceId>\<date:time>.zip .  

Thanks for any help :).

Link to comment
Share on other sites

  • 1 year later...

Hey guys,

I'm struggling to see the wood for the trees here, I am trying to sight my backups to a storage disk on the same server. I have come up with the bellow which passes syntax check but fails to execute.

BACKUP_LOCATION = Path.Combine("D:\TCAFiles\Users", ThisService.UserName, ThisService.ServiceId, "Backups")

Any correction would be greatly appreciative.

Kind regards,

Neill

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use