Link to home
Start Free TrialLog in
Avatar of Dan
DanFlag for United States of America

asked on

automate FTP transfer

What is the easiest way to automate an FTP transfer?  For example, I have an .mp4 file that I want to FTP to a location automatically everyday for 10 days, and on the 10th day, there will be 2 transfers that day.  Each day, the file name will be different.

I did some searching, and it doesn't look like filezilla support scripting.  I installed winscp, but I don't know much about scripting, so does anyone know of a free solution to do this, that is easy?

I guess I can also use the task scheduler to schedule the task, but not sure who to script winscp to start with the correct FTP settings.

Any ideas?
Avatar of Dan
Dan
Flag of United States of America image

ASKER

I guess I should figure it out from their own website, unless there's an easier way to do this.

http://winscp.net/eng/docs/guide_automation
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dan

ASKER

I actually want this to run on my windows server 2008 R2.  This way, if my PC shuts down or something, I don't have to worry about it.
Avatar of Dan

ASKER

it's FTP with explicit TLS, so that makes it a bit trickier
Avatar of Rich Weissler
Rich Weissler

WinSCP it is then.  :-)  And you have the manual already.
Avatar of Dan

ASKER

so on winscop documentation lists:

open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

But how do I find out what the rsa certficiate info is?
Avatar of Dan

ASKER

I ran the batch script from a cmd line and it's not doing anything.

If anyone is well versed with winscp I would greatly appreciate any help.

Here's what I have:

hofscript.bat

@echo off
"C:\Program Files (x86)\WinSCP\winscp.exe" /script=hofscript.txt


hofscript.txt

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server using a password
open ftp://user%40domain.org:password%21@ftp.domain.com/
# Upload file
put z:\hof01.mp4 /home/events/hof
# Disconnect
close



I did something wrong, as it's not working.  If anyone knows, I would appreciate it.

I have 10 files I need to upload, 1 per day, and 2 on the last day, so I'm not sure if I have to have 10 different txt documents or somehow if I can add the file names to this one txt file?
Do the steps manually, which helps isolate the issue.
> I have 10 files I need to upload, 1 per day, and 2 on the last day, so I'm not sure if I have to have 10 different txt documents or somehow if I can add the file names to this one txt file?

Pass the upload filename as an argument to the .bat file. See http://winscp.net/eng/docs/guide_automation#commands, Modifying the script automatically
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dan

ASKER

I think I found my solution, which is free as well.

http://www.2brightsparks.com/freeware/index.html

You can schedule when to perform the FTP transfers, seems easy to use and free.

Thanks, everyone.
Avatar of Dan

ASKER

Thanks again.