{"id":328,"date":"2024-06-19T02:35:46","date_gmt":"2024-06-19T10:35:46","guid":{"rendered":"https:\/\/blog.garrettware.com\/?p=328"},"modified":"2025-02-15T01:20:04","modified_gmt":"2025-02-15T09:20:04","slug":"clear-old-combat-logs-from-swtor","status":"publish","type":"post","link":"https:\/\/blog.garrettware.com\/index.php\/2024\/06\/19\/clear-old-combat-logs-from-swtor\/","title":{"rendered":"Clear Old Combat Logs from SWTOR"},"content":{"rendered":"\n<p>If you parse combat while playing SWTOR using <a href=\"https:\/\/apps.microsoft.com\/detail\/9p63t6zqmhbz?amp%3Bgl=US&amp;hl=en-us&amp;gl=US\" title=\"Orbs (Old Republic: Battle Parse)\">Orbs (Old Republic: Battle Parse)<\/a> or <a href=\"https:\/\/ixparse.com\" title=\"StarParse\">StarParse<\/a>, you may have a buildup of old combat logs.  <a href=\"https:\/\/ixparse.com\" title=\"StarParse\">StarParse<\/a> &amp; Orbs give warnings about the number and size of logs in the combat log folder, but it doesn&#8217;t delete old entries for you.  I wrote a small PowerShell script that is run daily via Task Scheduler that deletes combat logs older than a number of days.  I use 7 days myself, but it could even be 1 day because I&#8217;ve never gone back and looked at a log that old.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Define the folder path and the age threshold (in days)\n$folderPath = \"C:\\Path\\to\\your\\CombatLogs\"\n$daysThreshold = 7\n\n# Get the current date and calculate the threshold date\n$currentDate = Get-Date\n$thresholdDate = $currentDate.AddDays(-$daysThreshold)\n\n# Get all files in the folder older than the threshold date\n$filesToDelete = Get-ChildItem -Path $folderPath -File | Where-Object { $_.LastWriteTime -lt $thresholdDate }\n\n# Delete each file\nforeach ($file in $filesToDelete) {\n    try {\n        Remove-Item -Path $file.FullName -Force\n        # (optional) Write-Output \"Deleted file: $($file.FullName)\"\n    } catch {\n        Write-Output \"Failed to delete file: $($file.FullName). Error: $_\"\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>$folderPath<\/strong>:  Your combat logs are typically located in your Documents folder, specifically: &#8220;C:\\Users\\<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">[username]<\/mark>\\OneDrive\\Documents\\Star Wars &#8211; The Old Republic\\CombatLogs&#8221;<\/p>\n\n\n\n<p><strong>$daysThreshold<\/strong>:  The number of days to keep combat logs before deletion<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Running the Script Daily<\/strong><\/h3>\n\n\n\n<p>To run this script daily, you can create a scheduled task in Windows Task Scheduler:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open Task Scheduler<\/strong>: <br>You can find it by searching for &#8220;Task Scheduler&#8221; in the Windows start menu.<\/li>\n\n\n\n<li><strong>Create a New Task<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Select &#8220;Create Basic Task&#8221;.<\/li>\n\n\n\n<li>Name your task and give it a description.<\/li>\n\n\n\n<li>Choose &#8220;Daily&#8221; for the trigger.<\/li>\n\n\n\n<li>Set the start date and time for when you want the task to run.<\/li>\n\n\n\n<li>Select &#8220;Start a Program&#8221; for the action.<\/li>\n\n\n\n<li>Browse to <code>powershell.exe<\/code> as the program\/script.<\/li>\n\n\n\n<li>Add the script file path (e.g., <code>C:\\Path\\To\\Your\\Script.ps1<\/code>) in the &#8220;Add arguments&#8221; field.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>It&#8217;s that simple, and you no longer need worry yourself with cleaning up your old useless combat logs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you parse combat while playing SWTOR using Orbs (Old Republic: Battle Parse) or StarParse, you may have a buildup of old combat logs. StarParse &amp; Orbs give warnings about the number and size of logs in the combat log folder, but it doesn&#8217;t delete old entries for you. I wrote a small PowerShell script &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.garrettware.com\/index.php\/2024\/06\/19\/clear-old-combat-logs-from-swtor\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Clear Old Combat Logs from SWTOR&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":342,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,23],"tags":[78,74,76,75,52,77,51],"class_list":["post-328","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneous","category-star-wars-the-old-republic","tag-battle-parse","tag-combatlogs","tag-orbs","tag-parse","tag-star-wars","tag-starparse","tag-swtor"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":5,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/posts\/328\/revisions"}],"predecessor-version":[{"id":333,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/posts\/328\/revisions\/333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/media\/342"}],"wp:attachment":[{"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/media?parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/categories?post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.garrettware.com\/index.php\/wp-json\/wp\/v2\/tags?post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}