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, or you can also use the FilUnderscore's Mod Manager.
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": "",
    
    // Write debug information to the logs/log.txt file and to the in-game/server console
    // Default: false
    "DebugMode": false
  },
  
  "AutoBackup": {
    // Is automatic backup enabled
    // Default: true
    "Enabled": true,
    
    // Auto backup delay (seconds)
    // Min: 10
    // Default: 1200 (20 minutes)
    "Delay": 1200,
    
    // Reset the delay timer after a manual backup
    // Default: false
    "ResetDelayTimerAfterManualBackup": false,

    // Skip the next scheduled backup, if there are no players on the server
    // Default: false
    "SkipIfThereAreNoPlayers": false
  },
  
  "Archive": {
    // Keep the last backup of the day
    // Default: false
    "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 world loaded
    // Default: true
    "BackupOnWorldLoaded": true,

    // Backup when the last player on the server disconnected
    // Default: false
    "BackupOnServerIsEmpty": false
  },
  
  "Notifications": {
    // Are ALL chat notifications enabled
    // Default: true
    "Enabled": true,

    "Countdown" : {
      // Are countdown chat notifications enabled
      // Default: true
      "Enabled": true,
      
      // Do a countdown * seconds before backup starts
      // Min: 1
      // Default: 5
      "CountFrom": 5
    }
  }
}

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

P.S. You can also change the UserGameData property in your serverconfig.xml or in the game startup arguments. Then by default it will use the next directories: '%UserGameData%/Backups/%WorldName%/%SaveName%' for backups, and
'%UserGameData%/Archive/%WorldName%/%SaveName%' for archive

 

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
'backup start' - start an AutoBackup process (even if disabled in settings.json)
'backup stop' - stop the current AutoBackup process


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
Upd. (see edit history)
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.

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

Link to comment
Share on other sites

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 

 

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

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)
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.

 

Link to comment
Share on other sites

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...

Changelog (v1.1.7) :

Two new features were added:

// Skip the next scheduled backup, if there are no players on the server
// Default: false
"SkipIfThereAreNoPlayers": false

and

// Backup when the last player on the server disconnected
// Default: false
"BackupOnServerIsEmpty": false


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...

Hi, this mod looks like a must have.  I'm wondering where to edit the settings file to backup my saves at this location - D:\7D2D\Mods\Saves  I'd like to backup that folder and put the backup archive(s) at D:\7D2D\Backups.  I did read over the instructions but it seems both areas are the backup locations.  Thank you.

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

  "CustomBackupsFolder": ""
 "CustomArchiveFolder": ""

from the first post... You can configure the modlet by modifying the 'settings.json' file, .  those two lines above i believe ar the ones to edit. i presume you add your custom path between the quotation marks.

Link to comment
Share on other sites

  • 2 weeks later...
4 hours ago, a_jp said:

what am i doing wrong
Please teach me.

1. you should check for releases and download these, if the author created/offer these before you download the master.

Look at the right side, Releases   v1.1.7. and download BackupMod.zip the next time

The master sometimes is just a work directory and sometimes don't work as mod.

But at BackupMod it should work.

 

2.When you unpack and copy the content of a mod archive, you should look what is inside.

You prolly have inside the backup-master another folder BackupMod.

Move BackupMod to Mods and delete BackupMod-master.

 

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

Canute! Thank you very much!
It seems the version is old.
[BackupModDemonstrationScreenV1.1.2]

and v1.1.7. I tried
Under the name of the attached map
A compressed backup file has been created!
/home/sdtd/.local/share/7DaysToDie/Backups/PREGEN10k/My Games
(After . is a hidden file)

Even if you delete all backup compressed files
A new backup compressed file has been generated!

---
The sentences may be strange due to translation.
excuse me.
---
Canute様、ありがとうございます!
うん。バージョンが古かったみたい。
[BackupModDemonstrationScreenV1.1.2]

そして v1.1.7。をやってみた。
付けてるマップの名前下に
バックアップの圧縮ファイルが作成されました!
/home/sdtd/.local/share/7DaysToDie/Backups/PREGEN10k/My Game
(.以降は隠しファイル)

なおバックアップ圧縮ファイル全部を消しても
新しいバックアップ圧縮ファイルが生成されました!
 

5 hours ago, Canute said:

1. マスターをダウンロードする前に、作成者がこれらを作成/提供している場合は、リリースを確認してダウンロードする必要があります。

右側を見てください、リリース v1.1.7。次回はBackupMod.zipをダウンロードします

master は単なる作業ディレクトリである場合もあれば、mod として機能しない場合もあります。

しかし、BackupMod では動作するはずです。

 

2. mod アーカイブのコンテンツを解凍してコピーするときは、中身を確認する必要があります。

おそらく、バックアップ マスター内に別のフォルダー BackupMod があります。

BackupMod を Mods に移動し、BackupMod-master を削除します。

 

 

IMG_2040.jpg

Link to comment
Share on other sites

I think I encountered a bug in the latest Release (1.1.7). Before launching the game, I edited the settings.json file and changed the value of AutoBackup:Enabled to false, but autobackups still occur.

 

Spoiler
{
  "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": false,
    
    // Auto backup delay (seconds)
    // Default: 1200 (20 minutes)
    "Delay": 1200,

    // Skip the next scheduled backup, if there are no players on the server
    // Default: false
    "SkipIfThereAreNoPlayers": false
  },
  
  "Archive": {
    // Keep the last backup of the day
    // Default: false
    "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 world loaded
    // Default: true
    "BackupOnWorldLoaded": true,

    // Backup when the last player on the server disconnected
    // Default: false
    "BackupOnServerIsEmpty": false
  },
  
  "Utilities": {
    // Chat notifications
    // Default: true
    "ChatNotificationsEnabled": true
  }
}

 

Link to comment
Share on other sites

automatic backup
I would like to know the string to stop it.

during the program
    // Default: true
the same as
  //do not do: abc
like.

Because the creation language is not the native language,
I just don't understand w

2 hours ago, alphaniner said:

最新のリリース (1.1.7) でバグに遭遇したと思います。ゲームを起動する前に、settings.json ファイルを編集し、AutoBackup:Enabled の値を false に変更しましたが、自動バックアップは引き続き発生します。

 

  隠された内容を明らかにする
{
  "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": false,
    
    // Auto backup delay (seconds)
    // Default: 1200 (20 minutes)
    "Delay": 1200,

    // Skip the next scheduled backup, if there are no players on the server
    // Default: false
    "SkipIfThereAreNoPlayers": false
  },
  
  "Archive": {
    // Keep the last backup of the day
    // Default: false
    "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 world loaded
    // Default: true
    "BackupOnWorldLoaded": true,

    // Backup when the last player on the server disconnected
    // Default: false
    "BackupOnServerIsEmpty": false
  },
  
  "Utilities": {
    // Chat notifications
    // Default: true
    "ChatNotificationsEnabled": true
  }
}

 

 

IMG_2042.jpg

Link to comment
Share on other sites

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...