Not sure if anyone came across this, but I will offer troubleshooting tips and / or alternative methods.
I have a Windows 2008 server on which I run several scheduled tasks. One of these tasks is a python script that uses pscp to enter the linux window, check for new files and, if there is anything new, copy them to a local directory on the C: drive. I put some entries in the script at key points, and I use logging.basicConfig(level=DEBUG) .
I built the command using the variable command = 'pscp -pw xxxx name@ip :/ c:\local_dir' , and then I use subprocess.call(command) to execute the command.
Now here is the weird part. If I run the script manually from the command line, it works fine. New files are uploaded and processed. However, if the task scheduler runs the script, new files are not loaded. The script runs under the same user, but it gives different results.
According to the log files created with the script and in the linux window, the script successfully enters the linux window. However, the files do not load despite the presence of new files. Again, when I run it through the command line, the files are downloaded.
Any ideas? suggestions, alternative methods?
Thanks.
python scp scheduled-tasks
user1070061
source share