用于在 Linux 系统中基于FTP服务传送文件
工具
NcFTP Software
下载[root@izhp34pg9zy2co3hcg83lfz ncftpput]#wget https://www.ncftp.com/downloads/ncftp/ncftp-3.2.6-src.tar.gz --2022-05-08 17:53:14-- https://www.ncftp.com/downloads/ncftp/ncftp-3.2.6-src.tar.gz Resolving www.ncftp.com (www.ncftp.com)... 209.197.102.38 Connecting to www.ncftp.com (www.ncftp.com)|209.197.102.38|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 636425 (622K) [application/x-gzip] Saving to: ‘ncftp-3.2.6-src.tar.gz’ 100%[===================================================================================================================================================================>] 636,425 13.1KB/s in 43s 2022-05-08 17:53:59 (14.4 KB/s) - ‘ncftp-3.2.6-src.tar.gz’ saved [636425/636425] [root@izhp34pg9zy2co3hcg83lfz ncftpput]#ll total 624 -rw-r--r-- 1 root root 636425 Dec 5 2016 ncftp-3.2.6-src.tar.gz解压
[root@izhp34pg9zy2co3hcg83lfz ncftpput]#tar -xzvf ncftp-3.2.6-src.tar.gz ncftp-3.2.6/ ncftp-3.2.6/autoconf_local/ ncftp-3.2.6/autoconf_local/acconfig.h ncftp-3.2.6/autoconf_local/aclocal.m4 ncftp-3.2.6/config.h.in ncftp-3.2.6/configure ncftp-3.2.6/configure.in ………………省略一大堆…………………… ncftp-3.2.6/win/setup/Windows Installer Wizard/ ncftp-3.2.6/win/setup/Windows Installer Wizard/NcFTP/ ncftp-3.2.6/win/setup/Windows Installer Wizard/NcFTP/NcFTP.sln ncftp-3.2.6/win/setup/Windows Installer Wizard/NcFTP/NcFTP.vdproj [root@izhp34pg9zy2co3hcg83lfz ncftpput]#安装
## README.txt 说的很清楚
1. (Optional) Install ncurses (available from a GNU mirror).
2. Run the "./configure" script in the NcFTP source directory.
3. (Probably not necessary) Inspect the Makefiles in each subdirectory.
4. (Probably not necessary) Browse and edit config.h.
5. "make"
6. "make install"
配置
[root@izhp34pg9zy2co3hcg83lfz ncftpput]#ll total 628 drwxr-xr-x 13 root wheel 4096 Dec 5 2016 ncftp-3.2.6 -rw-r--r-- 1 root root 636425 Dec 5 2016 ncftp-3.2.6-src.tar.gz [root@izhp34pg9zy2co3hcg83lfz ncftpput]#cd ./ncftp-3.2.6 [root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#ll total 412 drwxr-xr-x 2 root wheel 42 Dec 5 2016 autoconf_local -rw-r--r-- 1 root wheel 14392 Nov 13 2016 config.h.in -rwxr-xr-x 1 root wheel 324292 Dec 5 2016 configure -rw-r--r-- 1 root wheel 9436 Dec 5 2016 configure.in drwxr-xr-x 4 root wheel 328 Dec 5 2016 doc -rw-r--r-- 1 root wheel 286 Aug 6 2006 DONATE.txt drwxr-xr-x 2 root wheel 4096 Dec 5 2016 libncftp drwxr-xr-x 3 root wheel 19 Dec 5 2016 mac -rw-r--r-- 1 root wheel 1531 Oct 26 2001 Makefile.bin.in -rw-r--r-- 1 root wheel 5356 Aug 14 2016 Makefile.in drwxr-xr-x 3 root wheel 4096 Dec 5 2016 ncftp -rw-r--r-- 1 root wheel 1815 Sep 30 1999 NcFTP_All.dsp -rw-r--r-- 1 root wheel 4625 Sep 30 1999 NcFTP_All.dsw -rw-r--r-- 1 root wheel 7812 Apr 13 2010 NcFTP_All.sln -rw-r--r-- 1 root wheel 1613 Apr 8 2010 NcFTP_All.vcproj -rw-r--r-- 1 root wheel 3536 Aug 6 2006 README.txt drwxr-xr-x 2 root wheel 304 Dec 5 2016 sh drwxr-xr-x 2 root wheel 4096 Dec 5 2016 sh_util drwxr-xr-x 2 root wheel 4096 Dec 5 2016 sio drwxr-xr-x 2 root wheel 4096 Dec 5 2016 Strn drwxr-xr-x 2 root wheel 130 Dec 5 2016 vis drwxr-xr-x 4 root wheel 31 Dec 5 2016 win [root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#./configure creating cache ./config.cache checking if you set and exported the environment variable CC... no (configure will try to locate a suitable C compiler) checking for environment variable CFLAGS... no (we will choose a default set for you) checking for environment variable CPPFLAGS... no checking for environment variable LDFLAGS... no checking for environment variable LIBS... no ……………………省略一大堆 checking NDEFS... -DLINUX=40000 -DLINUX_GLIBC=21700 checking LDFLAGS... -L/vdb1/ncftpput/ncftp-3.2.6/libncftp -L/vdb1/ncftpput/ncftp-3.2.6/sio -L/vdb1/ncftpput/ncftp-3.2.6/Strn checking LIBS... updating cache ./config.cache creating ./config.status creating Makefile creating Makefile.bin creating ncftp/Makefile creating libncftp/Makefile creating Strn/Makefile creating sio/Makefile creating sh_util/Makefile creating vis/Makefile creating config.h [root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#编译
[root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#make make[1]: Entering directory `/vdb1/ncftpput/ncftp-3.2.6/Strn' Compiling DStrCat.c: [OK] Compiling DStrFree.c: [OK] Compiling Dynscpy.c: [OK] Compiling Strncpy.c: [OK] Compiling strtokc.c: [OK] Compiling DStrCatList.c: [OK] Compiling DStrInit.c: [OK] ………………………………一大堆……………………………………………… Compiling gl_getline.c: [OK] Compiling version.c: [OK] Compiling ncftpget: [OK] Compiling ncftpput: [OK] Compiling ncftpbatch: [OK] Compiling ncftpls: [OK] Done making NcFTP shell utilities. make[1]: Leaving directory `/vdb1/ncftpput/ncftp-3.2.6/sh_util' make[1]: Entering directory `/vdb1/ncftpput/ncftp-3.2.6/vis' Done making NcFTP full-screen utilities. make[1]: Leaving directory `/vdb1/ncftpput/ncftp-3.2.6/vis' total 1064 -rwxr-xr-x 1 root root 298544 May 8 18:01 ncftp -rwxr-xr-x 1 root root 220560 May 8 18:01 ncftpbatch -rwxr-xr-x 1 root root 200048 May 8 18:01 ncftpget -rwxr-xr-x 1 root root 163024 May 8 18:01 ncftpls -rwxr-xr-x 1 root root 204144 May 8 18:01 ncftpput lrwxrwxrwx 1 root root 10 May 8 18:01 ncftpspooler -> ncftpbatch Done. ** Please report any problems to http://www.NcFTP.com/contact/ ** [root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#编译安装
[root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#make install make[1]: Entering directory `/vdb1/ncftpput/ncftp-3.2.6/ncftp' Done making NcFTP. make[1]: Leaving directory `/vdb1/ncftpput/ncftp-3.2.6/ncftp' make[1]: Entering directory `/vdb1/ncftpput/ncftp-3.2.6/sh_util' Done making NcFTP shell utilities. make[1]: Leaving directory `/vdb1/ncftpput/ncftp-3.2.6/sh_util' make[1]: Entering directory `/vdb1/ncftpput/ncftp-3.2.6/vis' Done making NcFTP full-screen utilities. make[1]: Leaving directory `/vdb1/ncftpput/ncftp-3.2.6/vis' mkdir -p "/usr/local" "/usr/local/bin" "/usr/local/etc" "/usr/local/share/man" "/usr/local/share/man/man1" 2>/dev/null ..... Installing the programs ..... /usr/bin/install -c bin/ncftp "/usr/local/bin/ncftp" /usr/bin/install -c bin/ncftpget "/usr/local/bin/ncftpget" /usr/bin/install -c bin/ncftpput "/usr/local/bin/ncftpput" /usr/bin/install -c bin/ncftpls "/usr/local/bin/ncftpls" /usr/bin/install -c bin/ncftpbatch "/usr/local/bin/ncftpbatch" make: [install] Error 1 (ignored) ln "/usr/local/bin/ncftpbatch" "/usr/local/bin/ncftpspooler" test -f bin/ncftpbookmarks && /usr/bin/install -c bin/ncftpbookmarks "/usr/local/bin/ncftpbookmarks" make: [install] Error 1 (ignored) ..... Installing the manual pages ..... /usr/bin/install -c -m 644 doc/man/ncftp.1 "/usr/local/share/man/man1/ncftp.1" /usr/bin/install -c -m 644 doc/man/ncftpget.1 "/usr/local/share/man/man1/ncftpget.1" /usr/bin/install -c -m 644 doc/man/ncftpput.1 "/usr/local/share/man/man1/ncftpput.1" /usr/bin/install -c -m 644 doc/man/ncftpbatch.1 "/usr/local/share/man/man1/ncftpbatch.1" /usr/bin/install -c -m 644 doc/man/ncftpspooler.1 "/usr/local/share/man/man1/ncftpspooler.1" /usr/bin/install -c -m 644 doc/man/ncftpls.1 "/usr/local/share/man/man1/ncftpls.1" ..... Finishing up ..... /usr/local/bin: -rwxr-xr-x 1 root root 298544 May 8 18:01 ncftp -rwxr-xr-x 2 root root 220560 May 8 18:01 ncftpbatch -rwxr-xr-x 1 root root 200048 May 8 18:01 ncftpget -rwxr-xr-x 1 root root 163024 May 8 18:01 ncftpls -rwxr-xr-x 1 root root 204144 May 8 18:01 ncftpput -rwxr-xr-x 2 root root 220560 May 8 18:01 ncftpspooler Done installing NcFTP. [root@izhp34pg9zy2co3hcg83lfz ncftp-3.2.6]#ll创建测试文件、文件夹
过程不展示了,太麻烦 创建文件夹 mkdir 文件夹名称 创建文件 touch 文件名称层级结构
创建了文件和文件夹,层级结构如下: ftptest 1.txt folder1 child child.txt folder1.txt folder2 folder2.txt发送
命令参考:ncftpput(1) manual page
[root@izhp34pg9zy2co3hcg83lfz ftptest]#ncftpput -R -A -d /vdb1/ncftpput/log.txt -u ftptest -p Hywd@1qaz -P 21 39.104.***.*** /mnt/ftpFolder /vdb1/ncftpput/ftptest /vdb1/ncftpput/ftptest/1.txt: 13.00 B 4.02 kB/s /vdb1/ncftpput/ftptest/folder1/folder1.txt: 11.00 B 25.28 kB/s /vdb1/ncftpput/ftptest/folder1/child/child.txt: 11.00 B 24.14 kB/s /vdb1/ncftpput/ftptest/folder2/folder2.txt: 12.00 B 27.00 kB/s啥意思
| 命令 | 含义 |
|---|---|
| ncftpput | 程序名称 |
| -R | 递归模式,复制目录下的所有目录和文件 |
| -A | 追加到远程文件,而不是覆盖它们,应该是比对文件,如果一样就不会二次传输 |
| -d | 记录日志,后面跟日志文件 |
| -u | ftp 用户名 |
| -p | ftp 用户的密码 |
| -P | 指定使用的端口号 |
| 39.104.53.178 | 远程主机 |
| /mnt/ftpFolder | 远程主机文件夹 |
| /vdb1/ncftpput/ftptest | 本机文件夹 |



