Hey running the Headless on our VPS running good one instance where the server left the game so auto save etc stopped working.
Anyway the server is auto saving to _autosave 1-3 .zip so if you close the server to restart or it crashes as above do you always have to manually rename the _autosave files? as the server never seems to save to the main .zip file (in my case SERVER.zip)
or did i do something wrong in the setup?
batch file calling the server...
start Factorio.exe --start-server SERVER.zip --autosave-interval 10 --latency 12
Headless save
Re: Headless save
When the server receives SIGINT (press Control-C in the console window, I believe this should work on Windows as well), it will save to the file you loaded from and quit. If it crashes or you kill it in some forceful way, it obviously won't save anything.
You can also run /c game.server_save() from the game console (from any connected peer) to tell the server to save now to the file you loaded. (You can also run game.server_save('filename') if you want to save to some other file.)
You can also run /c game.server_save() from the game console (from any connected peer) to tell the server to save now to the file you loaded. (You can also run game.server_save('filename') if you want to save to some other file.)
Re: Headless save
The way I've opted to solve this in my init script for linux is basically before starting the server I check the last modified save in the saves dir and make a copy of this to my --start-server save, in your case that would be pseudo code:
find last modified save
copy last modified save to SERVER.zip
start server
find last modified save
copy last modified save to SERVER.zip
start server
Hosting a factorio server? Take a look at this || init script ||.
Re: Headless save
I run a headleess windows server (12.10) and Ctrl+C to kill the server does not trigger a save to the main file.Oxyd wrote:When the server receives SIGINT (press Control-C in the console window, I believe this should work on Windows as well), it will save to the file you loaded from and quit. If it crashes or you kill it in some forceful way, it obviously won't save anything.
You can also run /c game.server_save() from the game console (from any connected peer) to tell the server to save now to the file you loaded. (You can also run game.server_save('filename') if you want to save to some other file.)
Like others, I have to go find the last autosave, accept the fact that it's going to be a bit of a rollback, and move that autosave into place.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Dec 26, 2015 8:02 pm
- Contact:
Re: Headless save
I'm getting access denied when I attempt this. Is there a new method the server function is being called as a result of a code base change?Oxyd wrote:When the server receives SIGINT (press Control-C in the console window, I believe this should work on Windows as well), it will save to the file you loaded from and quit. If it crashes or you kill it in some forceful way, it obviously won't save anything.
You can also run /c game.server_save() from the game console (from any connected peer) to tell the server to save now to the file you loaded. (You can also run game.server_save('filename') if you want to save to some other file.)
2d
Re: Headless save
No, there isn't.2disbetter wrote:I'm getting access denied when I attempt this. Is there a new method the server function is being called as a result of a code base change?Oxyd wrote:When the server receives SIGINT (press Control-C in the console window, I believe this should work on Windows as well), it will save to the file you loaded from and quit. If it crashes or you kill it in some forceful way, it obviously won't save anything.
You can also run /c game.server_save() from the game console (from any connected peer) to tell the server to save now to the file you loaded. (You can also run game.server_save('filename') if you want to save to some other file.)
2d
Which of the two ways are you attempting? And what error message exactly do you get? Are you sure Factorio has write access to the save file's location?
Re: Headless save
I was wondering if anyone knew a way to have a Windows or Linux shutdown tell the server to exit gracefully? I'm currently running a Windows VM for the server and it's a real pain every time Windows Updates or something else (like my rebooting the hypervisor) reboots the machine and the save doesn't get updated so I have to manually grab an autosave. I'm willing to switch to a CentOS server, and it seems like there's an init script that'll handle grabbing an autosave automatically, but it would still be nice to not be rolled back to an autosave in the event of a shutdown without terminating the server first.
I can't think of any methods on Windows, but I'm a real rookie with Linux so I don't even know where to start on that one.
Is this possible?
I can't think of any methods on Windows, but I'm a real rookie with Linux so I don't even know where to start on that one.
Is this possible?
Re: Headless save
sorry for being a bit late to the party - 0.12.31 fixed the graceful shutdown save, simply sending a SIGTERM equivalent on windows will save the map, ie if you gracefully shut down the process it will save to your designated save.zip fileKlynn wrote:I was wondering if anyone knew a way to have a Windows or Linux shutdown tell the server to exit gracefully? I'm currently running a Windows VM for the server and it's a real pain every time Windows Updates or something else (like my rebooting the hypervisor) reboots the machine and the save doesn't get updated so I have to manually grab an autosave. I'm willing to switch to a CentOS server, and it seems like there's an init script that'll handle grabbing an autosave automatically, but it would still be nice to not be rolled back to an autosave in the event of a shutdown without terminating the server first.
I can't think of any methods on Windows, but I'm a real rookie with Linux so I don't even know where to start on that one.
Is this possible?
Hosting a factorio server? Take a look at this || init script ||.