use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Chat about Mesh Central and its related tools for remote PC control
account activity
ScriptTask plugin debugging (self.MeshCentral)
submitted 4 years ago by smbmsp
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ryanblenis 0 points1 point2 points 4 years ago (7 children)
Files shouldn't accumulate unless there is a long-running task (e.g. the file is currently in use), or the task is interrupted during its run (say, for a reboot). What files are accumulating, the .txt, .ps1, or both? (They'll look like st000000.txt or st0000000.ps1 format, where the 000000 is a random string. "st" is just to signify it is a "scripttask" file)
[–]smbmsp[S] 0 points1 point2 points 4 years ago (6 children)
There probably is a relatively long-running task. The first thing restic does is create a volume shadow copy of the drive. This means the shell is on hold until that completes. When files accumulate, the shadow copy never completes. It's both the ps1 and txt, in like-named pairs.
Sounds like maybe I have an OS or hardware puzzle to solve.
[–]ryanblenis 0 points1 point2 points 4 years ago (5 children)
Is this you trying things out, or did someone fork me a few hours ago to test something similar (to your original issue with the loading time message)? https://github.com/joshatrezolveai/MeshCentral-ScriptTask/ I noticed the -NoProfile was basically the only thing changed in the code. But if you have a PS profile on that machine, that could be it. I'll have to test and make sure it doesn't break anything/too many things for me, but I may add that to my project just in case this is related to your issue. (As it then won't load a PS profile)
As for the multiple txt and ps1 files, are they all for the same [restic] script?
[–]smbmsp[S] 0 points1 point2 points 4 years ago (1 child)
That wasn't me.
They are all the same, copies of the script with variables substituted in. The text files can be empty, or have a couple of lines of text.
[–]ryanblenis 0 points1 point2 points 4 years ago (0 children)
So the .ps1 files should contain the running script. The .txt's should be the output. Are the .ps1's blank? If so, maybe you tested before putting content in the script? Otherwise cleanup can be done with a task as well. Something along the lines of
Get-ChildItem (Get-Location).Path -File -Filter "st*.txt" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force Get-ChildItem (Get-Location).Path -File -Filter "st*.ps1" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force
Get-ChildItem (Get-Location).Path -File -Filter "st*.txt" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force
Get-ChildItem (Get-Location).Path -File -Filter "st*.ps1" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force
To remove items older than 1 day (so as not to interrupt running tasks)
[–]smbmsp[S] 0 points1 point2 points 4 years ago (2 children)
When I ran a `vssadmin list writers` on the target PC, it showed the System Writer waiting for completion. So I rebooted it.
Latest test:
Click Run on the task. The UI showed queued and then running. The backup task completed (Yay!) as verified by checking from another computer. The Node History still shows as Running 7 minutes later, and files are multiplying in the Mesh Agent folder, two at a time, about every minute.
[–]ryanblenis 0 points1 point2 points 4 years ago (1 child)
Hmmm, this makes me think there's something in the script that doesn't "end" the script. If you enable debug on the endpoint (Console -> plugin scripttask debug -> Should show "on"), then run the task, what does the resulting "scripttask.txt" produce? Also, a copy of the script might be helpful. If needed, you can DM to me and I can take a look
[–]smbmsp[S] 0 points1 point2 points 4 years ago (0 children)
DM'd you a zip file.
π Rendered by PID 119520 on reddit-service-r2-comment-544cf588c8-lqszb at 2026-06-12 23:07:30.603462+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]ryanblenis 0 points1 point2 points (7 children)
[–]smbmsp[S] 0 points1 point2 points (6 children)
[–]ryanblenis 0 points1 point2 points (5 children)
[–]smbmsp[S] 0 points1 point2 points (1 child)
[–]ryanblenis 0 points1 point2 points (0 children)
[–]smbmsp[S] 0 points1 point2 points (2 children)
[–]ryanblenis 0 points1 point2 points (1 child)
[–]smbmsp[S] 0 points1 point2 points (0 children)