This might be helpful for those who need to rotate the chatlogs and server messages on the Linux Client. I found a discussion on reddit and found a script that can do this.
There are some caveats however:
1. If the server crashes, the script doesn't detect this and seems to keep on logging when re-entering the server without exiting the client
2. The script needs to run before launching the client once for it to run in the background. You have to repeat this step after restarting your PC or have it run at boot.
3. You must have the utility called entr installed. Normally, this can be installed via sudo apt-get install entr
How to create and install:
Step 1. Create an empty text file such as NWNchatlogrotator.sh and copy-paste the code below.
Chatlog Rotator Script
Code:
#!/usr/bin/env bash
export NWN_DIRECTORY=(insert the location of the NWN directory here without the parentheses such as /home/username/NeverwinterNights)
export LOG_DIRECTORY="$NWN_DIRECTORY/logs"
export LOG_FILE="$LOG_DIRECTORY/nwclientLog1.txt"
rotate_log() {
entr bash -c '
cp "$LOG_FILE" "$LOG_DIRECTORY/$(date +%d-%m-%G-%H-%M-%S.log)"
echo "Log rotated!"
'
}
find "$LOG_DIRECTORY" -name "nwclientLog1.txt" | rotate_log
Step 2. Save the file to your NWN directory
Step 3. You have to make the file created an executable by going into terminal and go to your NWN directory and type chmod u+x ~/(name you gave the chatlog rotator script such as NWNchatlogrotator.sh)
Step 4. Run the script before loading your game client
Hope this helps fellow Linux client users.