Hi there
I'm trying to write a small script that will loop through all the files in a directory (for file in ls) and then to SFTP them one at a time onto my remote server.
My SFTP Command looks like this: sftp user@server
Very basic I know, I was wondering if there was a way to pass an extra param to sftp (say -f filename) of the file that I would like to put onto the remote server. Another switch that would be useful I guess would be to first specify the target directory as well.
Is it better to use the -B Batchfile option in order to achieve this? I tried it but when I run the command:
psftp user@server -B batchfile I get the following error:
usage: sftp [-1vC] [-osshopt = value] [user@]host
Any help would be great!
Thx
I'm trying to write a small script that will loop through all the files in a directory (for file in ls) and then to SFTP them one at a time onto my remote server.
My SFTP Command looks like this: sftp user@server
Very basic I know, I was wondering if there was a way to pass an extra param to sftp (say -f filename) of the file that I would like to put onto the remote server. Another switch that would be useful I guess would be to first specify the target directory as well.
Is it better to use the -B Batchfile option in order to achieve this? I tried it but when I run the command:
psftp user@server -B batchfile I get the following error:
usage: sftp [-1vC] [-osshopt = value] [user@]host
Any help would be great!
Thx