I wanted to automate sftp and I did it through a C program using sshpass which calls sftp and pass to it the password together with a pointer from sftp to a text archive containing the rest of commands I should pass to sftp. This text archive I can edit as many times I want to fill with the name of the files which will be “puted” or “geted” so, basically what my C program does is to call sftp via sshpass but now I have an automated program to download or upload files to the server. And the files have the same name and nothing but to run the C program.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.