@iMelsom is right on all counts, regarding everything from the functions of the archives and backups, restores, and ‘save-all’.
My post here is just to throw more words at an already explained phenomenon because I love talking.
save-all
tl;dr “save-all” only affects block files, e.g., .mcr (minecraft region files)
archive
Archive collects and compresses into a single file all the files presently on the disk, within /var/games/minecraft/servers/[servername]
. Note, archive
gives a misleading sense of completeness, because when a server is running, the files on disk do not always fully reflect the state of the world you’re actually playing in. Even save-all
will only push the blocks to disk, but player inventories will not be.
backup
Similar to archive, but uncompressed and version controlled. Files that change from the last snapshot are added to the collection of files that grow and grow in /var/games/minecraft/backup/[servername]
. In this directory are always the most recent versions of the files. Older versions are stored “secretly” in a hidden .
directory, accessible to the user and any restore attempts.
putting it all together
This is a heavily contrived example of hourly backups & half hour save-all used for illustration:
AND, if you like visuals, here’s something I wrote up a decade ago! RAM & Minecraft world generation (but ignore the MB recommendations, since this was for alpha MC)
12:00 archive made, backup made – save-all scheduled, but doesn’t go when server is down.
-whatever is on the disk, the FULL entirety of the world, player inventories, are all saved, unquestionably.
12:15 server started
-files are updated, as usual when Minecraft launches. The world now differs in a non-meaningful way from what is on disk
12:25 Player A logs in at the spawn point, (Position M), goes for a 30 minute run toward the sun and stops at Position N.
-minecraft generates a lot of MCRegion files on the fly and saves them to disk. Player A’s occasional cutting down a tree as they are running is represented in game, but is not reflected on disk.
(caveat: if the java heap got filled up at any point from this run, position M might have gotten unloaded, which means M would actually get saved to disk, and a few other unloaded regions).
12:29 Player A disconnects, voluntarily or lost internet connection
-minecraft saves player’s inventory, position, that’s it.
12:30 save-all
-Spawn point (M) and all regions up to point N are saved to disk.
12:31 Player A reconnects
-current game state: 12:29 player state, 12:31 world state
12:45 Server crashes
-current game state: 12:29 player state, 12:30 world state
12:50 Admin does a restore (inadvertently overwriting new state)
-current game state: 12:00 player state, 12:00 world state
1:00 archive made, backup made – save-all scheduled, but doesn’t go when server is down.
-current game state: 12:00 player state, 12:00 world state