![](/uploads/1/2/5/8/125834473/446798282.jpg)
Automating SFTP Transfers. Ever wonder how to set up a way to automatically copy files from one computer to another? File Transfer Protocol (FTP) is the normal, most common way to copy files. Automate SFTP upload. See article Automate file transfers (or synchronization) to FTP server or SFTP server. You have landed on site of WinSCP. WinSCP is an open source free SFTP client and FTP client for Windows. We hope that you find it useful.
Active4 months ago
This question already has an answer here:
- How do I send a file with FileZilla from the command line? 4 answers
Consider:
This code doesn't work as it says:
'PATH NOT FOUND' K:YYXXXXXAAAABBidS.txt
However
just connects to the FTP site I wished without any file being transferred.
Why is it not working?
Peter Mortensen8,5881616 gold badges6262 silver badges8585 bronze badges
user295071user295071
marked as duplicate by random♦Dec 15 '15 at 16:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2 Answers
FileZilla does not have any command line arguments (nor any other way) that allow automatic transfer. See:
FileZilla Client command-line arguments
https://trac.filezilla-project.org/ticket/2317
How do I send a file with FileZilla from the command line?
FileZilla Client command-line arguments
https://trac.filezilla-project.org/ticket/2317
How do I send a file with FileZilla from the command line?
Though you can use any other client that allows automation. You have not specified what protocol you are using, the FTP or the SFTP.
You will definitely be able to use WinSCP as it supports all protocols that FileZilla does (and more).
See https://winscp.net/eng/docs/guide_automation
Typical WinSCP script for upload looks like:
To run the script use:
This is for SFTP. If you are using FTP, just replace the
sftp://
with the ftp://
and remove the -hostkey=...
The WinSCP 5.9 can generate a script from an imported FileZilla session.
For details, see the guide to FileZilla automation.
(I'm the author of WinSCP)
Another option, if you are using SFTP, is psftp client:
https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter6.html#psftp
Martin PrikrylMartin Prikrylhttps://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter6.html#psftp
12.7k44 gold badges3838 silver badges9999 bronze badges
-a
tells the FileZilla client where local files work should be done. That is, it's where files should be downloaded to or uploaded from by default (if no specific paths are used in the transfer command itself). It's expects a path to a folder.
From the FileZilla documentation:
-a, --local=
Sets the local site (left-hand side) to the given path.
Use double quotation for paths with spaces in them.
FileZilla isn't intended to be scripted (their goal is to be a GUI client), so there's no way to specify files to transfer from the commandline.
Perhaps look into using Windows' in-built
FTP.exe
for scripting.From
Peter Mortensenftp /?
:8,5881616 gold badges6262 silver badges8585 bronze badges
Ƭᴇcʜιᴇ007Ƭᴇcʜιᴇ007102k1616 gold badges164164 silver badges229229 bronze badges
Not the answer you're looking for? Browse other questions tagged scriptuploadfilezilla or ask your own question.
Active2 years, 7 months ago
I'm looking for a way to upload files/dirs structure from one server to another.. The only way it's possible in my case is SFTP upload, is there any easy way to upload it, using script or something without making archive of files/dirs, I want to recreate on remote server?
Thank you!
PavelPavel
![Sftp Sftp](/uploads/1/2/5/8/125834473/257078677.png)
3 Answers
Perhaps a solution could be found using recursive scp (scp -r)? Or are you limited explicitly to sftp only?
There's also a client named lftp which has sftp and scripting support - much like batch file I would imagine - a list of ftp commands. (http://lftp.yar.ru/lftp-man.html)
John BarrettJohn Barrett
You may want to consider Syncplify.me FTP Script! as a solution. It allows you to write very simple scripts to achieve your goal. For example, uploading an entire directory to a remote SFTP server would actually be a single line of code added to one of the ready-made templates.http://www.syncplify.me/products/ftp-script/
FjodrSoFjodrSo
edtFTPj/PRO is a Java SFTP client that has a comprehensive scripting engine. Being Java you can run it on any platform where Java is supported.
Here's some more details on the scripting support. It has an 'mput' command that uploads all the files in the current directory to the remote directory.
Recursive transfers aren't yet supported, but could easily be added if required - email support if you are interested.
Bruce BlackshawBruce Blackshaw90011 gold badge77 silver badges1010 bronze badges
Not the answer you're looking for? Browse other questions tagged sftp or ask your own question.
![](/uploads/1/2/5/8/125834473/446798282.jpg)