question

Leah-0287 avatar image
0 Votes"
Leah-0287 asked LimitlessTechnology-0326 answered

task scheduler creating backup, but saving to wrong location

I have a task set up to create a scheduled daily backup. I am trying to have the zip file sent to this specific location: C:\FCCS\Backup\FCCSBackup.ps1

However the zip files are saving to this location: C:\Windows\System32

Attached are two screenshots; the first one is of the details of the Action in Task Scheduler. The second screenshot is of the location the files are being sent to.

Any idea why this is happening and how I can fix it?

204769-untitled1.png204842-untitled.png


windows-server-powershell
untitled1.png (74.0 KiB)
untitled.png (43.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

Nobody knows what's in the script you're running. If it doesn't set (or specify) the correct location in which to store your data, then you need to fix that in your script -- or maybe add the directory in the "Start in" box.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-0326 avatar image
0 Votes"
LimitlessTechnology-0326 answered

Hello

Thank you for your question and reaching out. I can understand you are having issues related to scheduled daily backup path location.

Please check from script if its using Generic path variable like $Path then it should take default path C:\Windows\Sytem32

You can also use Script Tracing and Logging which should save debug logs of PowerShell execution.


Start-Transcript -path "C:\BackupLog.txt"

Stop-Transcript


https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/whats-new/script-logging?view=powershell-7.2



--If the reply is helpful, please Upvote and Accept as answer--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.