1

I need to access sftp USER@sfile.WEBSITE.com and get 20110310statement.pdf to a directory $HOME\STATEMENTS at 3am everyday.

I don't know how to do it in a script giving username and password and figuring the date string on Windows.

I suggest python, but am open to any scripting language.

Any pointers ?

Humble Debugger
  • 4,439
  • 11
  • 39
  • 56

2 Answers2

2

Have you tried paramiko? and you can use the time module to get the current date and format it however you please.

Community
  • 1
  • 1
theheadofabroom
  • 20,639
  • 5
  • 33
  • 65
  • +1 Paramiko works nicely. The only problem I've run into with it is with some oddball SFTP servers not returning the cwd when they should. If you ever run into problems with relative paths or filenames "not found", give it absolute paths instead. – robots.jpg Mar 11 '11 at 18:22
  • @Humble: If this is satisfactory, could you please accept this answer - if not then please give guidance as to any further problems you might be having. – theheadofabroom Mar 15 '11 at 11:11
0

Instead of building something from scratch, you might want to look at using cygwin and rsync or GoodSync or MS SyncToy

Don
  • 542
  • 3
  • 6