1

We got a database where every Monday a Excel file gets uploaded from a client. The file is always the same name so if we forgot it we lost it. Is there a way how we can make a script that renames the script and gives it the date or a number?

We're using FileZilla to get the files now.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Heis
  • 606
  • 5
  • 25
  • Do you want to make a script that automatically runs every Monday, connects to an FTP (or an SFTP) server, downloads a file with a fixed name to a local folder, saving it to a name that is different each time? – Martin Prikryl Mar 26 '15 at 09:09
  • yes would be nice, its a FTP server and i want it to download the file to a local folder with a different name every time. but thats exactly what i mean. – Heis Mar 26 '15 at 09:39

1 Answers1

0

FileZilla does not allow any kind of automation.


You can use this WinSCP script:

open ftp://user:password@host/
get "/path/sheet.xls" "c:\archive\sheet-%TIMESTAMP#yyyy-mm-dd%.xls"
exit

The script connects to the server, downloads the sheet to a local archive under a name like sheet-YYYY-MM-DD.xls.

For details see:


Then create a task in Windows scheduler to run the winscp.exe every Monday with arguments:

/script="c:\path_to_script\script.txt" /log="c:\path_to_script\script.log"

Logging (/log=...) is optional, but it's recommended.

For details, see Schedule file transfers (or synchronization) to FTP/SFTP server.

(I'm the author of WinSCP)

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Thanks for your answer i'm gonna use it, going to setup it now. – Heis Mar 26 '15 at 10:03
  • i made the script and edited the path and user password and host but it after that i followed the instructions from your site for windows scheduler but it seems that it cant be found i probably did something wrong but i cant see the task and its also not running. – Heis Mar 26 '15 at 11:02
  • *it cant be found*: What is it that cannot be found? – Martin Prikryl Mar 26 '15 at 11:38
  • the task in scheduler it says The selected task [0] does not exist, refresh if you want to show the current tasks. translated it but it is something like that. – Heis Mar 26 '15 at 11:46
  • Can you make a screenshot, upload it somewhere and post a link? – Martin Prikryl Mar 26 '15 at 11:48
  • http://i58.tinypic.com/b7ct2u.png and this is the error but its dutch, the code in script.txt is: open ftp://hrnet:password@ftp.hrnetwerk.nl/ get "/test.xls" "c:\test-%TIMESTAMP#yyyy-mm-dd%.xls" exit i changed the password above here but is is the good one in the real file – Heis Mar 26 '15 at 12:10
  • It looks good to me. Works for me with the same settings. Does the task disappear when you refresh the view? – Martin Prikryl Mar 26 '15 at 12:55