Task Scheduler Not Working Well

Advertisement

itzsnider
Guest

Task Scheduler Not Working Well

Okay so I am trying to sftp to my server, grab all files in the directory, and then put them into my OneDrive folder locally.

What am I missing?

/command "open sftp://username:pwd@hostname/" "cd /epic/prdfiles/foundations/auditreports" "get -r *" "put C:\Users\USER\OneDrive\Auditing\Data Courier\POC to REL" "exit"[/m]

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Task Scheduler Not Working Well

I assume you wanted to do:

... "get * ""C:\Users\USER\OneDrive\Auditing\Data Courier\POC to REL\""" ...

Note that there's no -r switch to get (it's recursive implicitly)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Task Scheduler Not Working Well

To debug this, wrap the winscp.com call to a batch file and redirect its output to a file:

winscp.com /command .... > c:\path\winscp.out

And reference the batch file in Scheduler, instead of the WinSCP.

Try to run and inspect the winscp.out.

Make sure the scheduler account has a write access to the path.

Reply with quote

Advertisement

You can post new topics in this forum