I have a script to move files from one mapped drive to another, works fine in script console.
Running as a gateway timer script, it doesn't.
I've changed the Ignition service to run under my domain user account that I'm logged into the SCADA workstation as.
Looking at the post above, the 2nd part of the suggestion is to not use ":P\" but use explicit "\\computername\foldername\"
However, the machine I am writing to (archive path) is not on the domain, this is why I went for a mapped drive option so I didn't have to start worrying about passing through credentials.
Is there any way round this for a machine on the LAN but not the domain?
File "", line 6, in OSError: (2, 'No such file or directory', 'S:\')
import os, shutil
system.util.getLogger("PRT_Transfer").info("PRT transfer triggered")
inputPath = "\\\\S:\\"
archivePath = "\\\\I:\\"
print inputPath
files = os.listdir(inputPath)
archive = os.listdir(archivePath)
if len(files) > 0:
for file in files:
if file not in (archive) and file.endswith('.PRT'):
shutil.move(inputPath + file, archivePath + file)
print "moved prt"
system.util.getLogger("PRT_Transfer").info("moved prt")
else:
print "no new files to transfer"
system.util.getLogger("PRT_Transfer").info("no new files to transfer")
else:
print "Zero files"
system.util.getLogger("PRT_Transfer").info("Zero files")
Edit: sorry when proof reading I see it's not even getting past input path. I can make that explicit as it's on domain, but my thoughts are once it's past that it's going to stop at :I\