diff --git a/bin/mosh-clean.ps1 b/bin/mosh-clean.ps1 new file mode 100755 index 0000000..db76872 --- /dev/null +++ b/bin/mosh-clean.ps1 @@ -0,0 +1,10 @@ +#!/usr/bin/env pwsh + +$days = 5 + +$to_delete = ps *mosh-server* | ? { $_.RunTime -gt (New-TimeSpan -Days $days) } +foreach ($proc in $to_delete) { + $proc | fl Id,RunTime + kill $proc +} +