Help Needed: Random PDF File Not Uploading at Scheduled Time

0
7
Asked By CuriousCoder42 On

I'm facing a strange issue with my script that automatically moves all PDF files from a shared location to a local folder every night at 1:00 AM for FTP uploading. For some reason, on some nights, one file fails to upload, and it's always the first file when sorted alphabetically. I've checked, and it's not consistent; it's almost like an off-by-one error, but it's puzzling since this doesn't happen every night. The process runs against a shadow copy taken an hour before the script runs, and I can see that all files are present, but the script reports one less than expected. No one is removing files manually, given the time of this operation and the permissions set. Below is a portion of my script for reference, with some parts omitted for brevity. I'm completely stumped and would appreciate any insights on what might be going wrong or how to troubleshoot this.

1 Answer

Answered By SyntaxSavvy On

I've run into a similar issue before, and in my case, switching to a .NET approach worked better. Instead of doing everything in a single move, I implemented separate steps: copy, verify, and delete. This way, I had much better control over each file processed. It’s surprising how something that seems simple can cause so much frustration in PowerShell.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.