I have read documentation on SCP and just trying to figure out how go about doing this - below are two pieces of code, one is SFTP and one is SCP. My goal is to have this done via password-less authentication, fully automated.
I have a script a.sh, which has an sftp command:
echo "Starting to sftp..."
sftp xxx@xxx.xxx.xxx.xx << END_SCRIPT
ls
mput *.csv.gz
bye
END_SCRIPT
echo "Sftp successfully."
If I run it interactively, the log output from sftp is shown. However, if I set it in a crontab and redirect the stdout to a file using >, there will be only the output from the two echo statements.
Hi,
I am not able to give the password in Unix script for SFTP connection.
When I am trying to manully SFTP command for accessing the server , it asking for pwd and I could provide the pwd but I am not getting how to provide the pwd inside the Unix script.
Code:
sftp -v user@xyz.com.
This command is working but how to pass password for connecting the server via Unix bash script.
B
I have written a Unix Script to automate the process of File transfer from Our server to vendor Server but the automation Script fail when Progress meter is around 65-70% Complete.
I have read through several threads (which have been helpful) and I'm still getting an error when trying to sftp a file (client wants it to be sftp'ed)
Here is the script:
#!/bin/bash
HOST=XX.XX.XX.XX
PORT=XXXX
USER=root
FILE=/tmp/RANDY
/usr/bin/expect<<EOD
spawn sftp -o Port=$PORT $USER@$HOST
expect "sftp>"
spawn put $FILE
interact
EOD
The error I am receiving is:
spawn sftp -oP
Hi,
I want to execute shell script with in sftp session for remote server.
like i have a shell script test.sh that is on local server.i want to execute that script on remote server
sftp user@192.168.56.10
sftp> test.sh ---execute for remote server not for local server.
sftp oracle@192.168.56.101 << EOF
cd /home/ibney
test.sh # i want to execute this shell script on
I was hoping to get a little insight into an expect script that I've written.
Basically we have this expect script to perform an sftp upload, key authentication is not an option, and sftp is the only method supported by our vendor, thus the need for this.
I want to be able to catch timeouts and log an error code for scripting purposes.
I need to:
Log into sftp site
Begin Transfer
Detect that
Hi All,
I am using SFTP command to transfer the file.
Code:
SRC=`pwd`
DIG=123
/bin/sftp -B /dev/stdin xyz@abc.net <<::
mput ${SRC}/GGG.${DIG}.tar.gz
bye
::
The problem is, after entring into sftp command, it is not taking variable values of SRC and DIG.
can someone help me what is the other way.
Hi Experts,
I am writing one shell script. Below is the requirement
1. need to login to the SFTP server, go to the particular folder
2. take the file count in that folder and assign it to variable
3. came out of the SFTP server and check the condition, if the file count is less than the required count exit the script other wise further processing
4.