i want to write a shell script to stop my currently running jboss applications(may more than one jboss running in one server) and rename the corresponding log files generated in the log directory.Renamed file must contain the time when the script is running,that will helps to identify that file.Please help me…
Redhat – how to write a Script to stop jboss and rename the corresponding log file in redhat
jbossredhatscriptingshell
Related Topic
- Bash – how to write a script that only acts on new log entries
- Bash – How to rename multiple files by replacing word in file name geting from the shell script variables
- Java – How to change Jboss’ logging directory
- PowerShell Script – How to Pull Files from PCs and FTP
- Linux – Is it safe to stop a Jboss EAP server with Kill -9
Best Answer
You can use logrotate as suggested by Ignacio. For example, the following configuration snippet shows how to logrotate the system messages file and reloading the syslogd process. You can use prerotate and postrotate to execute scripts/commands before and after rotating the log file respectively.
For more info, check
man logrotate
.