〖linux〗 upload a single file to the FTP shell command line (function)

Source: Internet
Author: User
Tags ftp upload file ftp client server port

1#!/bin/bash-2#===============================================================================3 #4# File:ftp_put_file.SH5 # 6# USAGE:./ftp_put_file.SH 7 # 8 # DESCRIPTION:9 # Ten# OPTIONS:--- One# REQUIREMENTS:--- A# BUGS:--- -# NOTES:--- - # author:linkscue (scue), [email protected] the # ORGANIZATION: - # created:2014 August 03 01:14 25 sec CST -# REVISION:--- -#=============================================================================== +  - # FTP upload file + # relies on the ncftp command A put_action () { atsrv=$1# FTP Server Addr -port=$2# FTP Server Port -user=$3# FTP Client User -     passwd=$4# FTP Client Passwd -     dir=$5# File storage directory -     file=$6# files to be uploaded intmp=/tmp/$ (basename$0) _$$.txt -     Cat<<-eof >$tmp toCD $dir +Put $file - Bye the EOF *Ncftp-u $user-P $passwd$srv $port <$tmp $     RM-F $tmpPanax Notoginseng } -  thePut_action192.168.1.201  +Scue123/Dropbear.SH 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.