Every so often, I run a XOJO program that creates over a hundred files and places them into about a dozen folders. Using a third-party FTP program, I then upload those files to a third-party web server using SFTP. This basically involves using the FTP software to sign into my account and dragging and dropping the contents of the dozen or so folders into the corresponding folders on the server and waiting for the files to get uploaded.
Can this process be automated with a Shell Script (which I currently know virtually nothing about)? Would it be a good approach?
The script would need to pass my account and password to the web server using ssh and then direct the files from my pc to the proper folders on the web server.
I’ve made some progress based on the Interactive Shell project under /Example Projects/Advanced/Shell/. I can now upload or download individual files or folders by issuing a shell command like:
which uploads a file from my desktop after I’m prompted for my account password.
But I’m wondering if this can be further streamlined to automatically enter the password, since third-party FTP software somehow does it without my having to do it each time.
Also, is there a limit to how big a file or how many files in a folder can be transferred this way before problems (like timeouts or whatever) are likely to occur?
If you would like I can send you a copy of my FTPUpload class that utilizes the CURL function from MonkeyBread software. It allows for SFTP transfers and entering the password, etc.
Might be easier than a shell script. I’m not sure if you use MonkeyBread plugins or not.
I was able to do an scp without needing to enter the password. It required generating an ssh-key on my local machine and storing the generated key in the .ssh/authorized_keys file in my account on the remote server. It seems to work well. Now when I enter the scp commands like the one mentioned above, the file is copied without being prompted for a password. Here are the instructions I followed to generate the key: