如何仅通过 FTP 部署新的和更改的文件

Ben*_*ine 2 automation deployment ftp

我正在为一家公司工作,该公司在某些情况下必须通过 FTP 部署 php web 应用程序。我正在自动化部署过程,需要编写一个脚本来将文件通过 FTP 传输到暂存和生产环境。

要求:

  1. 应该只将新的或更改的文件传输到远程服务器

限制:

  1. 在远程环境中没有任何类型的 shell 访问
  2. 无法使用 rsync
  3. 仅 FTP 可用

我的问题:是否有任何基于 FTP 的实用程序可以满足这些要求而不是自己编写?

Mad*_*ter 7

只要您控制客户端,您就可以在客户端上使用 FTPFS,然后将本地目录 rsync 到看似本地但实际上已挂载的 FTPFS 目录。

我知道 FTPFS 现在是LUFS 的一部分。

编辑:我很想链接到教程,但我通常只是从项目 wiki 开始,现在 sourceforge 似乎有些问题。CurlFTPFS,似乎是基于cURL和FUSE的,可以在这里找到,安装/卸载似乎很简单:

$ mkdir sunet
$ curlftpfs ftp://ftp.sunet.se/ sunet/
$ cd sunet/
$ ls -l
total 0
Dr-xr-xr-x   3 root root        96 Feb 23  2004 bin
dr-xr-xr-x   2 root root        72 Mar  2  2004 dev
dr-xr-xr-x   2 root root        48 Feb 23  2004 etc
dr-xr-xr-x   2 root root       120 Feb 23  2004 lib
-rw-r--r--   1 root root 622187310 Mar 11 06:13 ls-lR
-rw-r--r--   1 root root  76389037 Mar 11 06:15 ls-lR.gz
drwxrwxr-x  37 root root      1272 Feb 27 14:17 pub
dr-xr-xr-x   3 root root        72 Feb 23  2004 usr
$ cd ..
$ fusermount -u sunet/
Run Code Online (Sandbox Code Playgroud)