last day (15 days later) » 

6:49 PM
1
A: How to send another command to an existing process?

oli-verI think you want to send commands to an existing process, so I think this is what you are looking for: Execute external program using ProcessBuilder and provide input public class App{ public static void main(String... args) throws Exception { while (true) { Process process =...

 
This looks good, but it doesn't seem to work. :/ There won't be anything printed to the console, nor does the server stop.
 
Did you try this with two seperate threads, one for the outputs of the process and one for the input? Your while loop will not end until you close the server.
You should really not do this using Java at all. You want to start minecraft, stop it and then start a backup and then start minecraft again. This is standard operating system business and nothing you need a Java program for. Windows: corey.degrandchamp.com/2011/03/26/… Linux: wiki.natenom.de/minecraft/mcontrol
I edited the answer for the sake of a working example how to do this in Java. But I still think you should'nt :-)
 
Hi and thank you very much for the effort. I know that with the threads, I already tried it before, but it didn't work. I used System.out.println() and the debug mode to assert that the code actually runs, but it didn't work for some reason. How I do it doesn't really matter, but I need to be able to monitor the server.
 
I understand, so you want to have the server run by Java to do other things later. So, did my example work then? If the process exits after the "stop" commando, it should. Perhaps you need "stop\n". I will try myself later.
 
Ah wait, I made a mistake... I thought you actually SEND the command in a separate thread and do not listen to it. Problem solved, it works now. Thanks so much! :) But just for interest: Why is this a bad design? If you do it using java, you can run the program on linux AND windows if not mistaken.
 
6:49 PM
Hi TrudleR
I personally do not like the Java process builder. I understand that you want to start Minecraft in a program, that does other things. But then, you could think about starting minecraft from within Java. Why use the Process Builder at all?
When I use it, it's only because I want to run native Windows oder Linux processes that can not be invoked from Java.
 
7:29 PM
oliver?
 
yes?
 
ah you're here
I'm going to put it on github
 
Ok, nice.
Perhaps there are others that want to use this.
 
what I basically want to do are automatic restarts if the server crashes and daily backups if someone was online at that day
but to start primitive, I did an algorithm that does stupid backups with a "copy & replace" algorithm.
 
Ok :)
Well, I did things like this on Linux using scripts and cron jobs, but why not do it in a Java program.
You are right: If you make a binary for others they will be able to start it without configuring a server. That would mean a lot of time that can be spared.
 
7:37 PM
Ok
Dunno
I don't know what a cron job is. pretty new in the IT. I'm working since september 2015 :)
do you know what files/folders i should NOT commit on git? I'm using intellij
I was on this topic too, but the answers weren't really accurate
 
only sources and something to help user build it later
If you use no libraries, only native java the sources are enough.
A cron job is the pendant to a windows scheduled task, just in Linux
 
I'm setting up a gradle project
 
Ok, then the gradle files, too.
I did not use gradle yet, only Maven. But I think there is something like a "pom.xml"? :)
 
yeah it's called build.gradle
I don't really know gradle and maven, but I made some basic things already using gradle
It looks like gradle is overtaking maven in the near future anyways, so i didn't focus on that
the name is not set in stone btw, lol. i initially had another, started anew and wasn't able to use the same name (of course), should have deleted the other first
 
yes, I heard of it but had no time to look into it yet. I think in the background it uses the maven mirrors.
MinecraftDaddy? :) :)
 
7:45 PM
you mean for the dependencies?
yeah lol
 
yes
 
A dad watches over his children
and this tool should watch over minecraft, haha
 
:)
Ah ok... Ich glaub dann können wir auf deutsch weiter machen, richtig? ^^
 
Haha genau richtig, lol
 
Konnte man auf deiner Profilseite sehen, gut :) Also ich hab dem Projekt mal einen Stern verpasst
Dann schau ich da mal zwischendurch vorbei. Hab im Moment keinen Minecraft Server laufen, aber alle paar Monate haben ein paar Kumpels von mir mal wieder Bock drauf und dann setzen wir wieder was auf.
 
7:49 PM
ja ich hab mir extra einen odroid zugelegt
so als home server
der läuft jetzt 24/7, inklusive MC server
aber die backups manuell zu handeln und so... das ist ziemlich unnötige extraarbeit
 
Ja stimmt. Ich lass das immer auf meinem Server laufen, der ist besser angebunden was den Upload angeht. Da sind die DSL-Anbieter ja leider immernoch etwas kniepig mit...
Ist so ne Linux-Kiste von netcup.de
 
Ich bin vor kurzem umgezogen. 10mbit upload
und jetzt gibt's dann ein gratisupgrade auf 200, lol
 
200 mbit upload?
 
aber die 10mbit haben eig gut gereicht
ja
 
bei welchem anbieter denn? Unitymedia hat bei mir grad mal so 5 - 6 theoretisch und faktisch meistens nicht mehr als 2,5...
 
7:52 PM
Wohne in der Schweiz und in einem neubau. Da ist das internet extrem stabil. 100mbit download zur zeit und die werden zu jeder uhrzeit geliefert
wird ebenfalls auf 200 erhöht
 
Ah ok. Da habt ihrs aber gut in der Schweiz :)
 
ich habe gehört, dass es in DE ziemlich mühsam ist
 
Das höchste der Gefühle hier in Nordrhein Westfalen in Deutschland ist NetCologne in Köln
 
man liest ja auch ständig von wegen netzneutralität und so
 
Die haben so 40 Mbit upload
Aber in anderen Städten haben sie noch keine so schnellen Leitungen, expandieren aber... Da wart ich noch drauf :)
 
7:54 PM
ok? bei uns hat man immer mehr gleiche up und downloadgeschwindigkeit
 
Ja! So gehört sich das ja auch eigentlich... Gibt's bei uns allerdings nicht.
 
also ein anbieter hier, der grösste, bietet 1gbit up und download an sehe ich gerade
bei meinem anbieter sind zur zeit glaub max 400/400 möglich
aber das kostet dann so viel mehr, das lohnt sich nicht mehr
 
Jo, das braucht ja dann auch kein Mensch. so 20-30 würden mir schon reichen, gerade für so Cloud Sachen wie Dropbox
Oder halt für das Hosten von nem NAS, Minecraft Webserver usw :)
Hab im Moment owncloud halt auch auf dem Linux Server laufen, weil sowas zu Hause zu hosten einfach nix bringt bei so wenig upload.
 
ist owncloud ne gute alternative? ich habe gehört, dass viele leute ziemlich unzufrieden sind
und dass owncloud weit entfernt von der bequemlichkeit einer dropbox ist
 
Seit Version 8 gehts eigentlich ganz gut.
Version 5 und 6 waren ganz schlimm
Jetzt ist das mittlerweile so zuverlässig, dass das sogar von den ganzen Hochschulen hier eingesetzt wird. Da haben jetzt sehr viele so einen Dienst. Heißt ein bisschen anders, aber im Hintergrund läuft Owncloud
Und man kann halt auch Kontakte- und Kalender-Funktionen nutzen, alles selbst gespeichert und nicht irgendwo bei Google oder Apple abgelegt. Hat also schon Vorteile.
 
8:02 PM
Also meinst du aus Datenschutz-Sicht?
 
Hab da mal eine Seminararbeit drüber geschrieben und das in einer VM zu testen installiert. Kannst du dir gerne mal anschauen, ist ganz nett um das mal auszuprobieren. science-site.de/…
*zum
 
Das ist mir mittlerweile egal. Datenschutz braucht schon ein paar IT-Kenntnisse, die nicht jeder hat. Jeder, der sie nicht hat, ballert das zu Google hoch, also die wissen auch ohne mein Adressbuch über mich bescheid.
 
Joa werd damit nicht die Welt verändern, geht mir mehr um Prinzip.
*ums
 
Es ist schon wichtig, dass es die Gegenbewegung gibt. Aber manche übertreiben es auch.
Bei der personalisierten Werbung war der Aufschrei auch gross. Irgendwie war niemandem bewusst, dass er/sie bereits überwacht werden mit all dem Cookie-gedöns
Mich stört das eigentlich nicht gross. Der einzige Schutz ist die Verschlüsselung der eigenen Daten. Alles andere nützt nichts und vertrauen darf man nicht.
 
Jo, soweit man das selbst beeinflussen kann, kann mans halt machen
 
8:06 PM
Was auf fremden Servern lagert ist unsicher, auch wenn es die entsprechenden Firmen nicht so kommunizieren
 
Eben. Und Dienste wie Facebook und so sind halt nicht wirklich "kostenlos", das muss ja eigentlich auch jedem klar sein.
 
Stimmt
Aber ich persönlich zahle den Preis gerne
Ich schalte den Adblock auf bestimmten Seiten auch aus, oder wenn ich irgendwo einen interessanten artikel lese
oftmals klicke ich extra auf die werbung, wenn mir irgendwas gefallen hat
Bei FB lasse ich ihn zwar an, die verdienen auch mit den Daten genug.
 
Ja, so kann man das ja auch ganz gut unterstützen
 
Ich glaub, Facebook gehört zu den Betrieben weltweit, die die höchsten Löhne bezahlen.
 
Ja, solange die Werbung nicht stört ist mir das eigentlich egal
Nur wenn die meinen, die müssen damit den zu lesenden Inhalt überdecken und einen zwingen so was wegzuklicken, dann bleibt die Seite schön adblock geschützt.
 
8:10 PM
Genau
 

last day (15 days later) »