Jump to content

ntaklive
 Share

Recommended Posts

image.png.f050796cce9133a212aa83ce1100984d.png

Backup Mod
by ntaklive


Description
This modlet makes it possible to automatically backup and restore your game saves.

Settings

You can configure the modlet by modifying the 'settings.json' file.
If you changed the configuration when you were in game, you should re-enter to your world to apply changed settings.

 

{
  "General": {
    // Backups limit
    // Default: 10
    "BackupsLimit": 10,
    
    // Custom backups folder path
    // IMPORTANT: You must escape all '\' characters or use '/'
    // Example: "C:\\7DaysToDie\\Backups"
    // Default: ""
    "CustomBackupsFolder": ""
  },
  
  "AutoBackup": {
    // Is automatic backup enabled
    // Default: true
    "Enabled": true,
    
    // Auto backup delay (seconds)
    // Default: 1200 (20 minutes)
    "Delay": 1200
  },
  
  "Archive": {
    // Keep the last backup of the day
    "Enabled": false,

    // Backups limit
    // Default: 10
    "BackupsLimit": 10,
    
    // Custom archive folder path.
    // IMPORTANT: You must escape all '\' characters or use '/'
    // Example: "C:\\7DaysToDie\\Archive".
    // Default: ""
    "CustomArchiveFolder": ""
  },
  
  "Events": {
    // Backup when entering the world
    // Default: true
    "BackupOnWorldLoaded": true
  },
  
  "Utilities": {
    // Chat notifications
    // Default: true
    "ChatNotificationsEnabled": true
  }
}

By default, your backups for each save will be saved in the '%AppData%/Roaming/7DaysToDie/Backups/%WorldName%/%SaveName%' folder
and your archived backups for each save will be saved in the '%AppData%/Roaming/7DaysToDie/Archive/%WorldName%/%SaveName%' folder.

 

Commands

You can use the 'backup' command or its shortened version - the 'bp' command

'backup' - perform a forceful backup
'backup info' - show the current configuration of the mod
'backup list' - show all available backups
'backup restore' - restore a save from a backup
'backup delete' - delete a backup


Installation
1. Extract the downloaded .zip archive
2. Move the extracted 'BackupMod' folder to your 'Mods' folder


Compatibility
Required game version: Alpha 20

EAC Compatibility
Server only. To load in single-player mode, you must disable EAC.


Download
GitHub

 

Support
Support link

I hope this mod will be useful to someone 😛

Edited by ntaklive
Some topic appearance's changes (see edit history)
  • Like 2
Link to comment
Share on other sites

21 hours ago, HillBilly Bones said:

Hello, I like the idea for this Mod, but I am running a Linux server.  Was wondering if  this Mod could be made to be  compatible with Linux? (Ubuntu).

 Thanks for your work! 


Hi. I have just tried to install the mod on my Ubuntu virtual machine. It seems that the mod works fine. I think that you should try it yourself. 🤔

Link to comment
Share on other sites

17 hours ago, MikeyUK said:

Any chance of a little less spam in the server console?  Just hard to see other stuff, doesn't need the announcement stuff imo, or at least not all the lines of it.

 

image.thumb.png.6cd7eb3ea9c12e02f518df844b321bb0.png

 

Great mod thanks man :D


Hi. Check the latest release on GitHub. It will solve your problem.

  • Like 1
Link to comment
Share on other sites

Changelog (v1.0.5) :
- The backup process is now completely asynchronous (no more freezes)
- The in-menu configuration hot-reload feature was reworked
- Now if the configuration is incorrect, you will be given detailed information about the error
- The 'backup info' command was added
- Some corrections in the announcements

  • Like 1
Link to comment
Share on other sites

Posted (edited)

Changelog (v1.1.0) :

- The 'backup restore' command was added

- File location announcement was removed from the chat announcements

- Much code refactoring

There is great news! Now you can restore your backups directly from the game menu, automatically!
Just write 'backup restore' in the game console and you will see your available backups.
image.png.2730d4aaad322bb2d43764d29d900be4.png
Now write the 'backup restore *world id* *save id* *backup id*' command and enjoy. For example: 'backup restore 0 1 0'.

Edited by ntaklive
typo (see edit history)
Link to comment
Share on other sites

Lots of errors for v1.1.0 so I have reverted to previous version which works fine.

 

From error log:

 

2022-05-02T06:42:13 322.827 EXC Sequence contains no matching element
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00011] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at BackupMod.Services.SaveInfoFactory.GetFromSaveFolderPath (System.String saveFolderPath) [0x0002f] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
  at BackupMod.Services.WorldService.GetCurrentWorldSaveInfo () [0x0000c] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
  at BackupMod.ModApi+<StartWatchdogForCurrentWorld>d__1.MoveNext () [0x00031] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDe@%$#Notification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at BackupMod.ModApi+<>c+<<InitMod>b__0_0>d.MoveNext () [0x0005d] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
BackupMod.Services.LogWrapper`1:Exception(Exception)
BackupMod.<<InitMod>b__0_0>d:MoveNext()
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(<<InitMod>b__0_0>d&)
BackupMod.<>c:<InitMod>b__0_0()
ModEvent:Invoke()
<startGameCo>d__122:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

2022-05-02T06:42:13 322.830 ERR Full error message:
2022-05-02T06:42:13 322.832 ERR System.InvalidOperationException: Sequence contains no matching element
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00011] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at BackupMod.Services.SaveInfoFactory.GetFromSaveFolderPath (System.String saveFolderPath) [0x0002f] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
  at BackupMod.Services.WorldService.GetCurrentWorldSaveInfo () [0x0000c] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
  at BackupMod.ModApi+<StartWatchdogForCurrentWorld>d__1.MoveNext () [0x00031] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDe@%$#Notification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at BackupMod.ModApi+<>c+<<InitMod>b__0_0>d.MoveNext () [0x0005d] in <10452c9d1a9e493e9c0639f1ffa893fb>:0 

 

  • Prime WTH 1
Link to comment
Share on other sites

Changelog (v1.1.1) :

- Synchronization of backup and save directories is fixed


I have contacted MikeyUK to fix his bug and still waiting for the answer. This update may fix some problems.
If anyone else has some problems with the latest version of the mod, you should contact to me here or make an issue on GitHub.

Link to comment
Share on other sites

Posted (edited)

Changelog (v1.1.3) :

- Configuration structure was changed

- 'Archive' feature was added (today's last backup will be stored and won't be deleted with 'General.BackupsLimit')
(Look at the new configuration)

- 'backup list' command was added

- 'backup delete' command was added

Note that the structure of the configuration file has been changed. You must replace your old settings.json with the new one and reconfigure it.

If anyone has some problems with this version of the mod, you should contact to me here or create an issue on GitHub.

Edited by ntaklive
typo (see edit history)
  • Like 1
Link to comment
Share on other sites

Changelog (v1.1.4) :

- Recursive creation of folders if the Backups folder or the Archives folder was in the Saves folder has been fixed


If anyone has some problems with this version of the mod, you should contact to me here or create an issue on GitHub.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

just got a problem.

I manual delete SP saves and now Backup don't like to work anymore.

It give out error msg. because it can't access the old savegame folder's anymore.

And ofcouse it didn't do any backup's anymore.

 

Hmm, maybe i found the problem, there was still backups/archives with that names. And backup tried to lookup for these real  savefolder and they wasn't there.

Maybe you should add a failsafe. I don't think you can made a request to ask to delete these archives/backup when there isn't an actual save anymore.

Or at last the mod should still doing backup, even after the error.

 

  • Confused 1
Link to comment
Share on other sites

Posted (edited)

Hi. Thanks for your report!
I have fixed this bug in the latest version of the mod.

But I don't have enough time right now to make a complete fix for this bug. So the missing directories will now be created all the time if there are backups' or archives' folders available. I'll change this behavior later

 

Changelog (v1.1.5) :

- Existing backups are unavailable for 'backup restore' and similar actions fix


If anyone has problems with this version of the mod, you should contact me here or create an issue on GitHub.

Edited by ntaklive (see edit history)
Link to comment
Share on other sites

  • 3 weeks 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
 Share

×
×
  • Create New...