Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whats the best way to update a server jar for production without stopping/starting & using restart? #167

Closed
TomLewis opened this issue Feb 24, 2022 · 6 comments

Comments

@TomLewis
Copy link

I have an autoamted restarted every day, If I download a new PurPur, I want to be able to put it somewhere that itll auto update after restart, Ive read that just deleting the old JAR while its still running isnt good practise, and overwriting it is the same thing.

Can this be done with mark2 as its a wrapper? Seems like a job mark2 should do.

When its picking a jar it should be looking for the highest filename number, that would be simple enough.

@Column01
Copy link
Collaborator

mark2 has a .reload command which rescans the mark2.properties if you want to hard code the file name and a .jar command which tells mark2 to switch to the new jar file it finds following your pattern in the mark2.properties file for your jar file.

What you could do is:

  1. Make sure your mark2.properties jar pattern uses a wildcard like purpur*.jar where purpur-10.jar and purpur-11.jar would be examples of the updated jar name
  2. Update your jar file by downloading the new one and placing it in the server directory
  3. Open mark2 and run .jar to tell mark2 to change jars at the next restart
  4. Delete the file the old jar file the next day or whenever the server restarts next

There will be a message in the console telling you the new jar name it will switch to for a sanity check and when it restarts next, it will change to that file.

@TomLewis
Copy link
Author

Open mark2 and run .jar to tell mark2 to change jars at the next restart

TIl there is a .jar command!

is it safe to delete the old jar while its still running?

@Column01
Copy link
Collaborator

Column01 commented Mar 10, 2022 via email

@TomLewis
Copy link
Author

TomLewis commented Mar 10, 2022

Just tried running .jar on my test server thats on the same box as my survival, which made my survival restart somehow?
server might have crashed: not accepting connections or wrong port is being pinged. -- restarting. luckily it was quiet.

@Column01
Copy link
Collaborator

That's unrelated to .jar and probably means it froze or something and its just a coincidence.

@TomLewis
Copy link
Author

Nope, it was the reason! The server was not under stress and there were no errors from any plugins or a crash report, and it happened right after I run that command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants