2 Replies Latest reply: Feb 14, 2013 7:40 PM by User356928 RSS

    How to turn on verbose for SFTP?

    User356928
      Hi,

      I am using a SFTP but I am not able to turn on verbose for SFTP.

      Below is the one I use which works fine in moving the files but I want the verbose on to see the activity details.

      SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME <<EOF
      cd $P_DEST_DIR
      mput $P_FILE_PREFIX
      bye
      EOF`


      Please let me know in what way I can have verbose on?

      Thanks,
      Satish
        • 1. Re: How to turn on verbose for SFTP?
          Catch-22
          SFTP was created for interactive use. The progress command toggles the progress meter on or off. If I remember correctly, SFTP does not allow specifying the password credential at the command line. Alternatively you use the EXPECT scripting tool or setup SSH user equivalence.

          However, your question is how to get the progress bar when scripting lftp. As far as I can tell you are redirecting all output to the SFTP_LOG, which is the problem.

          For scripting I find it easier to use SCP. Or install CURL, which provides password support. For information about CURL, perhaps you will find the following useful:

          OL5 Howto: Installing and using cURL with support for SCP and SFTP
          OL5 Howto: Installing and using cURL with support for SCP and SFTP
          • 2. Re: How to turn on verbose for SFTP?
            User356928
            Thank you for the information.

            There should be some way turning on the verbose on for sftp...

            SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME <<EOF
            cd $P_DEST_DIR
            mput $P_FILE_PREFIX
            bye
            EOF`

            For example on FTP...I get the details captured in FTP_LOG

            FTP_LOG=`ftp -nv -i $FTPHOST << !
            quote user $FTPUSER
            quote pass $FTPPWD
            cd $FTPDIR
            lcd $local_path
            quit
            !`


            I am still checking but request u and others in forum to let me know if you find how to tweek the above sftp part...