Schedule upload of select files based on time period
Howdy,
I'm trying to work out a script I can run as a scheduled task that will upload any files that have changed or are new in a directory and this task will run every 4 to 8 hours, not sure yet. I can't get the time mask to work.
I've gotten this far with a script, but when I put the time flag in it fails.
I've tried running this by using a command line winscp.exe /script="c:\temp\test.txt" /parameter xmllog=c:\temp\log.txt
The log isn't helping me as there's not much in the log for info.
I want to upload files every 4 hours. The source directory is on a Windows server - not sure if the slash should be \ but I think so as it works fine until I put the time in as >8H
Then the destination I put as /TEST/Log-Folder
I want all files in the folder under temp to upload. I have tried putting the path as D:\Temp\*\*.*>8H and then D:\Temp\Logs\*.*>8H
#Automatically answer all prompts negatively not to stall the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# creds saved in winscp - username & pwd are saved
open Testsite
cd
# Force binary mode transfer
option transfer binary
# Put logs in remote directory from the last 8 hours
put D:/Temp/Logs/*.*>8H /TEST/Logs-Folder
close
# Exit WinSCP
Exit
I'm trying to work out a script I can run as a scheduled task that will upload any files that have changed or are new in a directory and this task will run every 4 to 8 hours, not sure yet. I can't get the time mask to work.
I've gotten this far with a script, but when I put the time flag in it fails.
I've tried running this by using a command line winscp.exe /script="c:\temp\test.txt" /parameter xmllog=c:\temp\log.txt
The log isn't helping me as there's not much in the log for info.
I want to upload files every 4 hours. The source directory is on a Windows server - not sure if the slash should be \ but I think so as it works fine until I put the time in as >8H
Then the destination I put as /TEST/Log-Folder
I want all files in the folder under temp to upload. I have tried putting the path as D:\Temp\*\*.*>8H and then D:\Temp\Logs\*.*>8H
#Automatically answer all prompts negatively not to stall the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# creds saved in winscp - username & pwd are saved
open Testsite
cd
# Force binary mode transfer
option transfer binary
# Put logs in remote directory from the last 8 hours
put D:/Temp/Logs/*.*>8H /TEST/Logs-Folder
close
# Exit WinSCP
Exit