brazerzkidaithegreen.blogg.se

Synkmark bookmark
Synkmark bookmark





synkmark bookmark

Set aLength to ((count of characters of this_text) - 1) Set AppleScript's text item delimiters to oldastid

synkmark bookmark

Set AppleScript's text item delimiters to replacement_string Set the item_list to every text item of this_text We fix that by temporarily appending a prefix and suffix "X". However, this will miss search_string if it is at the beginning or ending of this_text, since no split will be made there. We're going to split this_text at each searchString. Set AppleScript's text item delimiters to search_string Set oldastid to AppleScript's text item delimiters On searchAndReplace(this_text, search_string, replacement_string) Set cmd to "/bin/rm " & unarchivedLogPathĪppendScriptView("Removing unfiltered log:" & return & " " & unarchivedLogPath) Set unarchivedLogPath to dirPath & filename The log file numbered 8 is from 8 days ago. On tryRemoveWeeksConsoleLogsInDirPath(dirPath) Set aLogPath to (POSIX path of (tigerConsoleLogDir as string)) & user50x & "/console.log"įilterConsoleMessages(aLogPath, appNames, missing value, dirPath, pathToMe) Set user50x to (name of aFolder as string) Repeat with aFolder in tigerConsoleLogDirs Set tigerConsoleLogDirs to folders of tigerConsoleLogDir Set tigerConsoleLogDir to folder "Console" of folder "Logs" of folder "Library" of startup disk Todo: Make this work for non-admin users. Note: Tiger logs are in one big file instead of separate daily files. Filter and add this day's log to leopardMessagesįilterConsoleMessages(unarchivedLogPath, appNames, logFile, dirPath, pathToMe) Set unarchivedLogPath to dirPath & "system.log." & logFile Assumes that we have previously run tryUnarchiveWeeksLogsToDirPath()

synkmark bookmark

On filterMessagesToNewFile(appNames, dirPath, pathToMe) Set cmd to cmd & " " & quoted form of aAppNameĪppendScriptView(" From " & logFilePartOfName & " logs ago") Set cmd to perlFilterToolPath & " " & logPath & " " & destinPath Set perlFilterToolPath to quoted form of (pathToMe & "Contents/Resources/Scripts/") Set destinPath to quoted form of (outDir & "system." & logFilePartOfName & ".log") On filterConsoleMessages(logPath, appNames, logFile, outDir, pathToMe) Set cmd to "/usr/sbin/chown " & quoted form of myShortName & " " & quoted form of destinLogPath The authorization we just received should be good for 5 minutes Set myShortName to short user name of (system info) But wait there's more! Because we used admin privileges, the copy that we just made is owned by root, so filterMessagesToNewFile() won't be able to open it unless we chown so that we own it. Prepare the user for the Authentication dialog which is about to appear.ĭisplay dialog "We need administrator access in order to read your system logs and filter out relevant entries." Set badPermissions to verifyTextContains(errorString, "Permission") So we'll have to parse errorString for the word "Permission", as in "Permission denied". Unfortunately, aCode is useless since cp returns the same exit value, 1, for both inadequate permissions and file not found. Set cmd to "/bin/cp -pX " & quoted form of sourceLogPath & " " & quoted form of destinLogPath Set destinLogPath to dirPath & filename & ".0" Set sourceLogPath to "/var/log/" & filename Set cmd to "/bin/rm " & destinLogArchivePath Now delete the copy of the bz2 file, since we don't need it any more property posixHome : POSIX path of (path to home folder) " & dirPath & filenameĭo shell script cmd with administrator privilegesĬatLog("Executing: " & cmd & return & ".

#SYNKMARK BOOKMARK MAC#

Do not do the following, because it will *compile* the path to *my* home folder into the script, causing it to fail when run in other Mac accounts! Global namedOfLocalClientsToGetBookmarksFrom Property ourChromeExtensionId : "dopbhkfmgllfbimacbeopgifmflgelni" The above are all acted upon in 'try' blocks, so it's OK if some don't exist in certain context(s). Property scriptVersion : "0255 published " This script, may be downloaded from here: The entire package, which should include the latest version of (* Actually running this script requires that several other tools be included into







Synkmark bookmark