Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Log set to true, no email and error #63

Closed
pearlset79 opened this issue Jul 5, 2022 · 7 comments
Closed

With Log set to true, no email and error #63

pearlset79 opened this issue Jul 5, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@pearlset79
Copy link

Hello, the script is working really well for me except for one thing. If I have Send Email value set to Always and have the Log set to true, I get an error at the end of the script running saying it could not email because file is in use. The script does create a log. If Log is set to null, I do not get a log file, but get an email saying "Success". Is there a way to have a log and an email?

@alekdavis alekdavis self-assigned this Jul 5, 2022
@alekdavis
Copy link
Owner

I'm looking into this. Will let you know.

alekdavis added a commit that referenced this issue Jul 5, 2022
@alekdavis
Copy link
Owner

Should be fixed. Let me know.

@pearlset79
Copy link
Author

I ran the script and it created the log file but still no email. The log says "success" with no email errors. I have SendMail set to "Always" and Log set to true. Am I doing something wrong? Other 2 log options are set to null.

@alekdavis
Copy link
Owner

alekdavis commented Jul 7, 2022

Please run the backup script within the Start-Transcript block (see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.2) and -Verbose -Debug switches, e.g.:

Start-Transcript -Path "c:\logs\transcript.txt"
.\Plexbackup.ps1 ... -Verbose -Debug
Stop-Transcript

Then post the transcript file. I will take a look.

@pearlset79
Copy link
Author


Windows PowerShell transcript start
Start time: 20220707161534
Username: NUC-2-SERVER\Nicholas
RunAs User: NUC-2-SERVER\Nicholas
Configuration Name:
Machine: NUC-2-SERVER (Microsoft Windows NT 10.0.19044.0)
Host Application: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
Process ID: 9932
PSVersion: 5.1.19041.1682
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.1682
BuildVersion: 10.0.19041.1682
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcript started, output file is c:\logs\transcript.txt
PS C:\Windows\system32> cd I:\PlexBackupScript
PS I:\PlexBackupScript> .\PlexBackup.ps1

PS I:\PlexBackupScript> TerminatingError(Send-MailMessage): "The process cannot access the file 'I:\PlexBackupScript\20220707161602\Backup.log' because it is being used by another process."

TerminatingError(Send-MailMessage): "The process cannot access the file 'I:\PlexBackupScript\20220707161602\Backup.log' because it is being used by another process."
PS I:\PlexBackupScript> Stop-Transcript


Windows PowerShell transcript end
End time: 20220707171524


@alekdavis
Copy link
Owner

I do not see the transcript file, but first of all, did you try the latest version of the script?

@pearlset79
Copy link
Author

It would seem after getting the new script and making some small changes all is well....thanks for the script and support!

@alekdavis alekdavis added the bug Something isn't working label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants