SA-MP Server Log Rotation
#12

Quote:
Originally Posted by Westie
The 'cat' function reads the server_log.txt file, and pipes it to a new file (hense the >). Also, the timestamp is unique - it is the UNIX timestamp, bla bla (server.[timestamp].txt) The echo is to clear the old file, because what > basically means is; 'If not exist, create and write, if exist, overwrite'.
Yeah, I missed the bit where it overwrote the existing one.

In theory, it's possible to do the same thing on windows (I have the script ready to go to do the same thing) but as always the fact that the server opens exclusive access to the file hampers the ability to blank it afterwards (try echo "log clear" > server_log.txt and you get the "file is already open by another process" error).

It might be for the best if 0.2.5 includes a built in log rotator. Not difficult to add, and would please a lot of people.
Reply


Messages In This Thread
SA-MP Server Log Rotation - by KingJ - 16.09.2008, 18:50
Re: SA-MP Server Log Rotation - by pspleo - 16.09.2008, 18:55
Re: SA-MP Server Log Rotation - by kaisersouse - 16.09.2008, 18:56
Re: SA-MP Server Log Rotation - by KingJ - 16.09.2008, 18:57
Re: SA-MP Server Log Rotation - by ғαιιοцт - 16.09.2008, 18:57
Re: SA-MP Server Log Rotation - by kaisersouse - 16.09.2008, 19:02
Re: SA-MP Server Log Rotation - by KingJ - 16.09.2008, 19:05
Re: SA-MP Server Log Rotation - by ғαιιοцт - 16.09.2008, 19:16
Re: SA-MP Server Log Rotation - by KingJ - 16.09.2008, 19:21
Re: SA-MP Server Log Rotation - by ғαιιοцт - 16.09.2008, 19:22
Re: SA-MP Server Log Rotation - by KingJ - 16.09.2008, 21:11
Re: SA-MP Server Log Rotation - by KingJ - 16.09.2008, 21:41
Re: SA-MP Server Log Rotation - by Wash - 17.09.2008, 10:33
Re: SA-MP Server Log Rotation - by [M]deLux - 17.09.2008, 12:39
Re: SA-MP Server Log Rotation - by KingJ - 17.09.2008, 12:54
Re: SA-MP Server Log Rotation - by Wash - 17.09.2008, 13:50
Re: SA-MP Server Log Rotation - by KingJ - 17.09.2008, 18:10
Re: SA-MP Server Log Rotation - by mamorunl - 18.09.2008, 10:18
Re: SA-MP Server Log Rotation - by Wash - 18.09.2008, 14:01
Re: SA-MP Server Log Rotation - by chrisb345 - 18.09.2008, 19:23
Re: SA-MP Server Log Rotation - by Acoole - 18.09.2008, 20:44
Re: SA-MP Server Log Rotation - by -Sneaky- - 02.01.2009, 09:28
Re: SA-MP Server Log Rotation - by LethaL - 02.01.2009, 10:31
Re: SA-MP Server Log Rotation - by -Sneaky- - 02.01.2009, 10:37
Re: SA-MP Server Log Rotation - by kingdutch - 25.03.2009, 07:02
SA MP Server Log Rotation - by CipHoony - 22.07.2009, 10:10
Re: SA-MP Server Log Rotation - by Westie - 02.08.2009, 10:47
Re: SA-MP Server Log Rotation - by Machinehank34 - 11.08.2009, 16:06
Re: SA-MP Server Log Rotation - by Patrik356b - 25.08.2009, 21:03
Re: SA-MP Server Log Rotation - by shady91 - 08.10.2009, 03:53
Re: SA-MP Server Log Rotation - by DeltaAirlines12 - 21.10.2009, 22:07
SA MP Server Log Rotation - by brubsifiary - 28.12.2009, 02:03
Re: SA-MP Server Log Rotation - by Domenko - 19.02.2010, 15:53
Re: SA-MP Server Log Rotation - by Westie - 20.02.2010, 10:54
Re: SA-MP Server Log Rotation - by Westie - 10.03.2010, 01:39
Re: SA-MP Server Log Rotation - by viKKmaN - 10.03.2010, 18:34
Re: SA-MP Server Log Rotation - by Micko9 - 22.03.2010, 13:22
Re: SA-MP Server Log Rotation - by JernejL - 23.03.2011, 10:01
Re: SA-MP Server Log Rotation - by rapidhost - 04.12.2011, 12:33
Re : SA-MP Server Log Rotation - by ombre - 16.10.2012, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)