Need script to download new version of same file every day at set time

Advertisement

Raventhrone
Joined:
Posts:
2

Need script to download new version of same file every day at set time

Hello,

I am trying to create a WinSCP script/command to copy a server file to a local directory once per day using a scheduled task. I have been able to get it to work if the file is in my home directory but the file is in another directory above my home directory. I'm not a programmer so I just have no idea if this is even possible and would appreciate any help.

I started with a basic command that works. When I log in to the server, it puts me in a home directory set up by the organization.
/command "open sftp://username:password@ftp.server.ca/" "get test.txt C:\Users\Raventhrone\Desktop\"

I've then tried the following with no success:
/command "open sftp://username:password@ftp.server.ca/folder1" "get test2.txt C:\Users\Raventhrone\Desktop\"
/command "open sftp://username:password@ftp.server.ca/" "get /folder1/test2.txt C:\Users\Raventhrone\Desktop\"

I also played with some directory changing commands but can't seem to get anywhere. And I don't need to just go into a folder below my home directory, I need to go up to a completely different directory that I have access to, ie. "afs/domain.ca/software/windows/app/group/dropbox". My home directory by contrast would be "afs/domain.ca/home/e/r/username/".

Thanks for any assistance!

Reply with quote

Advertisement

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

Re: Need script to download new version of same file every day at set time

If you login in WinSCP GUI, can you navigate to the folder that contains the file you want to download?

Reply with quote

Raventhrone

Re: Need script to download new version of same file every day at set time

Yes, I can. I actually figured it out. I just put the path right after the server address...this I'm sure I tried before with no success but it works now.

Reply with quote

Advertisement

You can post new topics in this forum