first time transferring files with sftp
Working with an outside company to get some files over to them on a daily basis.
Requirement is to sftp files from our server to the customers sftp server.
Then archive the files on our server in a tar ball with time date stamp. Still need help with this.
To sftp to the customers server is:
SSH Server supporting SFTP and SCP
Connected to 123.456.789.123
Basically it's an sftp server with an Inbox only. Once files are sent to the Inbox, it moves the files to the required directory based on file type. So I just have to get the files to their Inbox.
Here's how I started the script, it does work, just wanted your thoughts.
spawn /usr/bin/sftp firstname.lastname@example.org
send "mput /directory1/*.*\r"
send "mput /directory2/*.*\r"
send "mput /directory3/*\r"
send "mput /directory4/*\r"
send "mput /directory5/*\r"
send "mput /directory6/*\r"
send "quit \r"
Hope this explains it clearly enough. Thank you!