Support Topic |
Status: |
Submitted |
Author |
Message |
VelvetX |
|
|
Post subject: how to get a dailyserverlog on a unixserver?????????
Posted: Feb 15, 2005 - 06:22 AM
|
|
Joined: Oct 30, 2004
Posts: 2
Status: Offline
|
|
Hi Folks,
lord, i solved the installation of the linux server lately, and it works great too.
but now i have two other questions:
First and most important for me....
how can i set the serverlog to a daily new log, from a unknown reason my server produces onle a pserver.log. but when i dl it and delete it on the server no new one is made. but i want to dl it frequently to safe space.
second.....
i tried to modify the plugall.txt, but what ever i try i always get errors by reloading it. i tried wordpad, notepad and editpad with all kind of settings but nothing works. when my girlfriend does it with editpad there is now error. any idea why?
any idea is welcome...
Vel  |
|
|
|
|
 |
maarten |
|
Post subject:
Posted: Feb 15, 2005 - 12:41 PM
|
|

Joined: Oct 20, 2002
Posts: 674
Location: DiGiLaNd
Status: Offline
|
|
Hi
Palace has a simple SSH command to switch your Palace Server logs. It is in the same folder as the start Palace: /bin
The command is: ./switch-logs
To get a daily Palace log you need to add this command to your crontab. This is a script demon that runs scripts at certain times set by you. You can have it execute the switch-loga daily, weekly, monthly etc.
Deleting the logs will just stop the logs completely because the server can no longer find the log file it was writing too.
To switch manually just SSH to the bin folder and type ./switch-logs
Crontabs depend on your server but I think the basics are explained in the Palace Linux Server manual. |
|
|
|
|
 |
jon_k |
|
Post subject:
Posted: Jun 23, 2005 - 05:03 AM
|
|
Joined: Apr 16, 2005
Posts: 45
Status: Offline
|
|
You posted this question quite a while ago, and seeing you only have ever done 2 posts -- you're probably never going to come back and figure this out. But oh well; perhaps someone else can benefit my answer.
Firstly, if you have SSH you need to edit your crontab as martyn said.
To do this type in SSH/Telnet type:
VISUAL="nano -bw"; crontab -e
The VISUAL="nano" sets the default editor for your session to nano. That way the crontab editor won't open in VI, which is a complicated text editor which would require a full tutorial here itslef to use.
Then add this following line to the Window that appears:
0 0,12 * * * /home/olympus/pserver9998/bin/switch-log
This will invoke the script twice daily, every 12 hours. If you only want it to do it once daily, remove the ",12" and it will only do it at midnight every day. Oh yeah, and of course -- put the path to your switch-log script!
Then hit CTRL-O to save changes, then CTRL-X to quit nano.
Now, find the ~/palace/bin directory for your server and open up switch-logs in nano. E.G.: jon_k@mepis$ nano switch-logs
Now delete all the lines from this config file by placing your curser at the top line (it starts there by default when you open the editor.) Now hold down CTRL-K to delete all the lines in the file.
Now add the following script instead:Code: |
#!/bin/sh
root=${2:-/home/olympus/pserver9998}
mv $root/logs/pserver.log $root/$instance/logs/pserver---`date +%B-%m-%d-%Y--%I-%M-%p`.log.txt
mv $root/logs/logit.txt $root/$instance/logs/logit---`date +%B-%m-%d-%Y--%I-%M-%p`.log.txt
kill -HUP `cat $root/logs/pserver.pid`
|
The /home/olympus/palace needs to read the path to your palace folder which has the 'logs' directory in it.
Now, twice daily your logs should be swapped and replaced with a new logfile. You might ask why I wanted you to rewrite your switch logs with my own version; that's because the timestamp in the filename is better.
Check it out:
-bash-2.05b$ ls -a
pserver---April-04-21-2005--12-00-AM.log.txt pserver---May-05-01-2005--12-00-AM.log.txt
pserver---April-04-21-2005--12-00-PM.log.txt pserver---May-05-01-2005--12-00-PM.log.txt
pserver---April-04-22-2005--12-00-AM.log.txt pserver---May-05-02-2005--12-00-AM.log.txt
pserver---April-04-22-2005--12-00-PM.log.txt pserver---May-05-02-2005--12-00-PM.log.txt
pserver---April-04-23-2005--12-00-AM.log.txt pserver---May-05-03-2005--12-00-AM.log.txt
pserver---April-04-23-2005--12-00-PM.log.txt pserver---May-05-03-2005--12-00-PM.log.txt
Easy to read -- and easy to manage. Good luck! |
|
|
|
|
 |
|
| |