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.
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.
Dear community,
I have to copy a file from Red Hat to another server that supports only SSH2.
SFTP command from Red Hat works fine, but since I have to insert SFTP command into a script, is it possibile to PUT file using SFTP in "one" line code?
Or, anyway, without using external file?
This works, but instead to put, it GET the file FROM the server:
Code:
sftp user@10.99.1.12:/
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
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.
I want a file to be uploaded daily to remote server using automated ftp command.
We have 5 servers running our code: A, B , C, D and E.
From local machine, we sftp the file to A.
Then ssh id@A
su - applicationname
sftp id@A
get
bye
tar -xzf
logout
logout
The same procedure we apply for others B to E.
Is there any way we can simplify this using script ?
We have requested linux team to provide passwordless authentication.
Hi
I need a specific user to be able to sftp to a server and get files from a specific location. The location is not the users home dir, i don't want the user to be able to view anything else apart from the files in that area.
e.g ftp file are is - /logging/phplogs
e.g user home is /home/<user>
Can anyone please explain how this can be acheived
Thanks
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