[72303] users/ryandesign/PCLauncher/PCLauncher.applescript

ryandesign at macports.org ryandesign at macports.org
Sun Oct 10 04:44:52 PDT 2010


Revision: 72303
          http://trac.macports.org/changeset/72303
Author:   ryandesign at macports.org
Date:     2010-10-10 04:44:49 -0700 (Sun, 10 Oct 2010)
Log Message:
-----------
Delete old logs

Modified Paths:
--------------
    users/ryandesign/PCLauncher/PCLauncher.applescript

Modified: users/ryandesign/PCLauncher/PCLauncher.applescript
===================================================================
--- users/ryandesign/PCLauncher/PCLauncher.applescript	2010-10-10 11:29:06 UTC (rev 72302)
+++ users/ryandesign/PCLauncher/PCLauncher.applescript	2010-10-10 11:44:49 UTC (rev 72303)
@@ -21,6 +21,7 @@
 property gLogDirectory : gPrefix & "/var/log/PlasmaClient"
 property gLogFile : ""
 property gLogLink : gLogDirectory & "/PlasmaClient.log"
+property kKeepLogs : 10
 
 -- Task enums
 property kTaskIdle : 0
@@ -245,6 +246,7 @@
 	end tell
 	
 	set gPid to (do shell script "(cd " & quoted form of gDataDirectory & " && " & quoted form of gPlasmaClientForGame & " " & quoted form of theUsername & " " & quoted form of thePassword & ") >& " & quoted form of gLogFile & " & echo $!")
+	do shell script "cd " & quoted form of gLogDirectory & " && ls PlasmaClient.*.log 2>/dev/null | sort -n -r | sed '1," & (kKeepLogs - 1) & "d' | xargs rm -f"
 	
 	quit
 end startGame
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101010/181bce7c/attachment.html>


More information about the macports-changes mailing list