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.
The following command sends one command to sftp using one line:
sftp -o PasswordAuthentication=no user@host" <<<"lcd /home"
How to send multiple lines to sftp using one line.
Hi Guys,
I am able to create a file with all the sftp command required.
I was able to ftp the files in the similiar fashion using ftp command. The following i used for ftp.
Code:
ftp -n < $filename
But when i try the same for Sftp.
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.
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.
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.
Each time I download a big file over sftp, the md5sum on the source machine doesn't match the md5sum I do on the destination machine.
I have a 13gig file on an Ubuntu 12.04 machine with openssh-server running.
I used FileZilla to download that file to my laptop over sftp. However, the file isn't exactly the same after the download completes.
Perhaps the FTP protocol isn't the best choice?
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
Hello all,
I am currently writing a script to send files to a server over sftp.