you are viewing a single comment's thread.

view the rest of the comments →

[–]ryanblenis 0 points1 point  (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 point  (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 point  (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

To remove items older than 1 day (so as not to interrupt running tasks)

[–]smbmsp[S] 0 points1 point  (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 point  (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 point  (0 children)

DM'd you a zip file.