pipe - Bash piping output and input of a program -
I am running a Minecraft server on my Linux box in a separate screen session. I am not very fond of the screen and I want to pipeline the pipeline of output (like a pipe) to a file on the server and some input from one file on the server (so that I can input and output from remote program On the server, like a dragon script) I'm not feeling too much, would anyone tell me how to do this?
Thanks, NikitaUtu.
It is not clear if you need the screen at all. I do not know the microwave server, but generally for server software, you can run it from the cronat entry and redirect the output to the log file.
Assume that your server kills at midnight on Sunday night (if we change this, then it is too short or too much to resume 1x per week or you have a temporary resume ), But for the basic idea of what to do, here is a crontab entry that starts the server every Monday in a minute after every Monday.
01 00 * * 1 dtTm = '/ bin / date + \% y \% m %% \% H \% m \% s`; Export DTMT; {/ Usr / bin / mineserver -o ..... your_options_to_run_mineserver_here ...; } & Gt; /tmp/mineserver_trace_log.$ {dtTm} 2 & gt; & Amp; 1 Consult your man page for crontab that the range of weeks of that day is 0-6 (0 = Sunday), and changes in the value of the week if 0! = Sunday
Normally I will break the code, so it is easy to read, but for crossbab entries, each entry should be all in one line (with some strange exceptions) and usually 1024b-8k There is a limit to how long the line can be. note that ';' '}' Is super-important before closing If it is omitted, you will get no deceptive error message, or there will be no error message at all.
Actually, you are redirecting any output to the file (including std-err output). Now you can do many things with output, you can use more or less to view the file, grep ERR $ {logFile}, write scripts Which are grep for error messages and then send you emails such as errors, etc., etc. You may have some system administrators working to get a managers user so that you can run a cronpt entry. In addition, if you are not comfortable using the Vi or AMACS editors, you may need help from others to create a crontab file
Finally, there are two digits that I have about the date logfile I want to know.
-
Good: One. If you die app, you do not have to capture the output to run it again and to understand why the work has stopped, this can save you a lot of time for long lasting programs. Placing dated files gives you the ability to prove that your boss, other, it is used to do this work fine, here are the log files . Keeping the log file, assume that there is useful information in it, gives you the opportunity for those files for the my fact ie : 1 second program is taken for processing, now it is taking 1 hour, etc. Poor: A. You have to set up a mechanism to touch the old log files, otherwise at some point everything will be closed, and when you finally know that the problem What was it, you know that your TMP / whatever you have used, is being fully used, complete. This will explain a bit, so get me the feedback The solution is not useful, so I do not want to spend time writing it.
I hope this helps!
Comments
Post a Comment