Tuesday, June 4, 2013

FTP Process in Shell Script

 echo -e "user $user_id $password
      ascii
      prompt
      $source_dir
      lcd ${DATA_PATH}
      $ftp_command $process_file
      bye“ > ftpfile
  ftp -n "$remote_server" < ftpfile 2>&1 1> $FTPLOG
  if (grep "^Login incorrect." $FTPLOG)
     then
        echo "ERROR LOGIN INCORRECT"
  fi
  if (grep "^Not connected." $FTPLOG)
     then
        echo "ERROR FTP CONNECT"
  fi
  if (grep "No such file" $FTPLOG)
     then
        echo "ERROR FTP NO SUCH FILE"
  fi
  if (grep "access denied" $FTPLOG )
  then
        echo "ERROR FTP ACCESS DENIED"
  fi
  if (grep "^Please login" $FTPLOG )
  then
        echo "ERROR FTP LOGIN"
  fi

No comments:

Post a Comment

Oracle Standard Package for Order Totals

  Purpose: Sometimes we need to show line-wise or complete order totals (Basic / Tax / Tax+Basic) in reports. Oracle provides a standard...