script-server icon indicating copy to clipboard operation
script-server copied to clipboard

Script Logging

Open dragonborn117 opened this issue 1 year ago • 3 comments

Hi, I have a couple scripts that I dont want the output saved anywhere. I'm ok with being aware a script was run in logging, but I dont want the output saved anywhere locally. That includes if a file needs to be downloaded. Obviously i'm ok the user downloads the file but I dont want a local copy saved of the file.

Thanks.

dragonborn117 avatar Sep 18 '24 13:09 dragonborn117

Hi @dragonborn117 unfortunately this is not possible. You can add a callback to script server, which would remove the files after a script is finished, see for the usage. https://github.com/bugy/script-server/issues/200#issuecomment-478363470

bugy avatar Sep 18 '24 14:09 bugy

I have also encountered this issue. I have several scripts that run continuously, generating about 10MB of log files per hour. I tried to delete these log files but they were being used by Python. Here's an idea: could I run an additional script to clear the contents of these log files and then save them?

Hi @dragonborn117 unfortunately this is not possible. You can add a callback to script server, which would remove the files after a script is finished, see for the usage. #200 (comment)

xueli12 avatar Dec 18 '24 20:12 xueli12

I have several scripts that run continuously, generating about 10MB of log files per hour. I tried to delete these log files but they were being used by Python.

This is a different problem - you have log files that never close. You have a couple of options, maybe...

Easy option, if it works: rename the log file, and then send the process a HUP signal. If this works, the renamed file will close, and the process will open a new file with the original name. Then you can actually delete the old file.

Harder option, if that doesn't work: Your script will need to track how much data has been logged, and do the close-rename-reopen process itself.

On Wed, Dec 18, 2024, 3:37 PM xueli12 @.***> wrote:

I have also encountered this issue. I have several scripts that run continuously, generating about 10MB of log files per hour. I tried to delete these log files but they were being used by Python. Here's an idea: could I run an additional script to clear the contents of these log files and then save them?

Hi @dragonborn117 https://github.com/dragonborn117 unfortunately this is not possible. You can add a callback to script server, which would remove the files after a script is finished, see for the usage. #200 (comment) https://github.com/bugy/script-server/issues/200#issuecomment-478363470

— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/770#issuecomment-2552222856, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HBI3TQJOE6PBBTNNJZPZT2GHMG5AVCNFSM6AAAAABONVA5FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJSGIZDEOBVGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MNeill73 avatar Dec 18 '24 21:12 MNeill73