You should not be injecting insecure plaintext passwords into sftp with the expect brute-forcing tool. sftp allows you to use keys, which will make your life much, much simpler, since you can script it directly, run it and wait, instead of having to micromanage every line it prints and reads. Also far more secure, since your scripts will not need to contain your password in plaintext anymore!
The | grep -q 'No such file' might be useless because the error likely goes to stderr, while the pipe reads from stdout.
You need some additional file descriptor magic such as 2>&1 | grep ... (merge stderr with stdout) or 2>&1 >/dev/null | grep ...(merge stderr with stdout then suppress stdout, i.e. capture only stderr).
Further the exit status is reverse: if grep finds something (an error), the exit status is zero!
The following runs directly on the get stuff, lets grep print an error,
and adds an "okay" otherwise.
Last edited by MadeInGermany; 09-04-2013 at 06:38 PM..
We have a unix/linux server , that send mass email from it , the emails will pass the smtp gateway , email server and sent to the client , but sometimes the client do not receive the mail , we do not know the reason and when it will happen .
We would like to have a script that check when the... (2 Replies)
Hi All,
We are working on linux with putty terminal for file transferring using SFTP server...
here we want to know /We have Urgent Requirement
If SFTP connection is successfull then we should get .txt log file in target locaton as "Success/Failure"
Please provide batch script for above... (7 Replies)
In shell script, I want to transfer files continuously and make sure transfer is successful.
Please advise... how to make sure ftp transfer is successful?
Also is there any option such as sftp -b where I can pass multiple put <file name> commands to ftp
Thanks! (1 Reply)
Hi Friends
I need to check the status of FTP connection i.e. Whether it is successful or not
I have tried this by assigning the FTP connection script to a variable and after that using this variable I tried to check the status.
In the below code snippet I am trying to assign the FTP... (1 Reply)
Hi All,
I have a requirement to check if the merge of files is successful or not. The script to merge files goes like this,
cat Rewards_Header Rewards_Siebel_Notif_temp Rewards_Siebel_Remind105_temp > Rewards_Siebel
Sometimes, the file Rewards_Siebel misses records from file... (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a script that performs a post processing action:
The run time environment of the script has the... (2 Replies)
All,
I am using a for loop to SCP a bunch of files in a directory. I am having it then drop a .ready file name. Is there a way to check for the success of all iterations and then email upon fail or success?
Example of part of my script:
for file in $ORIGLOC/*
do
] &&... (2 Replies)
Hi,
I am doing sftp from remote server1 to remote server2. This is done through a script.
This script was working fine. But if i am tranfer files of 120 MB only some part of the file gets transferred (around 9 MB).
Incase i put the same file manually it gets uploaded successfully.
Can... (1 Reply)
Hi,
We have an interesting problem with F-Secure SSH (v 3.1.0) running on HP-UX. It seems that when scp or sftp commands are issued they are successful but it counts as a 'strike' against the target user locking the account out after 3 attempts.
When the user is re-enabled in SAM - it reports... (4 Replies)