sitecopyを使ってコンテンツをミラーリングする方法

2014年06月07日 18時54分

201406071854TCYW00.png

はじめに

ホームページのコンテンツのアップロードは、Windows環境の場合FFFTPなどのFTPクライアントを使っていると思いますが、 FTPクライアントを起動してアップロードを行うのは、更新頻度が多いサイトの場合やはり面倒です。 今回は、sitecopyによるローカルとリモート(ホームページ)のミラーリング方法を解説します。

前提条件

作業の前提条件は、下記のとおりです。

ソフトウエアバージョン
OSWindows 7 Ultimate 32bit
CygwinSetup Version 2.831

sitecopyのインストール方法

  1. パッケージのインストール

    sitecopyのビルド時に必要なlibintl1および、libneon-develパッケージをインストールします。

    $ apt-get install libintl1
    $ apt-get install libneon-devel
    
    インストールログ(libintl1)
    Working directory is /cache
    Mirror is http://ftp.iij.ad.jp/pub/cygwin/, Architecture is x86
    --2014-06-07 17:14:01--  http://ftp.iij.ad.jp/pub/cygwin//x86/setup.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 436097 (426K) [application/x-bzip2]
    Saving to: `setup.bz2'
    
    100%[======================================>] 436,097     1.59M/s   in 0.3s
    
    2014-06-07 17:14:01 (1.59 MB/s) - `setup.bz2' saved [436097/436097]
    
    Updated setup.ini
    
    Installing libintl1
    Found package libintl1
    --2014-06-07 17:14:02--  http://ftp.iij.ad.jp/pub/cygwin//x86/release/gettext/libintl1/libintl1-0.10.40-1.tar.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 11120 (11K) [application/x-bzip2]
    Saving to: `libintl1-0.10.40-1.tar.bz2'
    
    100%[======================================>] 11,120      --.-K/s   in 0.09s
    
    2014-06-07 17:14:02 (120 KB/s) - `libintl1-0.10.40-1.tar.bz2' saved [11120/11120]
    
    Unpacking...
    Package libintl1 requires the following packages, installing:
    cygwin
    Package cygwin is already installed, skipping
    Package libintl1 installed
    
    201406071854TCYW01.png
    201406071854TCYW02.png
    インストールログ(libneon-devel)
    Working directory is /cache
    Mirror is http://ftp.iij.ad.jp/pub/cygwin/, Architecture is x86
    --2014-06-07 17:20:01--  http://ftp.iij.ad.jp/pub/cygwin//x86/setup.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 436097 (426K) [application/x-bzip2]
    Saving to: `setup.bz2'
    
    100%[======================================>] 436,097     1.51M/s   in 0.3s
    
    2014-06-07 17:20:01 (1.51 MB/s) - `setup.bz2' saved [436097/436097]
    
    Updated setup.ini
    
    Installing libneon-devel
    Found package libneon-devel
    --2014-06-07 17:20:01--  http://ftp.iij.ad.jp/pub/cygwin//x86/release/neon/libneon-devel/libneon-devel-0.29.6-3.tar.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 91429 (89K) [application/x-bzip2]
    Saving to: `libneon-devel-0.29.6-3.tar.bz2'
    
    100%[======================================>] 91,429       510K/s   in 0.2s
    
    2014-06-07 17:20:02 (510 KB/s) - `libneon-devel-0.29.6-3.tar.bz2' saved [91429/91429]
    
    Unpacking...
    Package libneon-devel requires the following packages, installing:
    bash gettext libexpat-devel libiconv libneon27 libproxy-devel openssl-devel zlib-devel coreutils sed
    Package bash is already installed, skipping
    Package gettext is already installed, skipping
    Working directory is /cache
    Mirror is http://ftp.iij.ad.jp/pub/cygwin/, Architecture is x86
    
    Installing libexpat-devel
    Found package libexpat-devel
    --2014-06-07 17:20:03--  http://ftp.iij.ad.jp/pub/cygwin//x86/release/expat/libexpat-devel/libexpat-devel-2.1.0-3.tar.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 220720 (216K) [application/x-bzip2]
    Saving to: `libexpat-devel-2.1.0-3.tar.bz2'
    
    100%[======================================>] 220,720     1.34M/s   in 0.2s
    
    2014-06-07 17:20:03 (1.34 MB/s) - `libexpat-devel-2.1.0-3.tar.bz2' saved [220720/220720]
    
    Unpacking...
    Package libexpat-devel requires the following packages, installing:
    libexpat1
    Package libexpat1 is already installed, skipping
    Package libexpat-devel installed
    Package libiconv is already installed, skipping
    Package libneon27 is already installed, skipping
    Working directory is /cache
    Mirror is http://ftp.iij.ad.jp/pub/cygwin/, Architecture is x86
    
    Installing libproxy-devel
    Found package libproxy-devel
    --2014-06-07 17:20:05--  http://ftp.iij.ad.jp/pub/cygwin//x86/release/libproxy/libproxy-devel/libproxy-devel-0.4.11-2.tar.bz2
    Resolving ftp.iij.ad.jp (ftp.iij.ad.jp)... 202.232.140.170
    Connecting to ftp.iij.ad.jp (ftp.iij.ad.jp)|202.232.140.170|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 13836 (14K) [application/x-bzip2]
    Saving to: `libproxy-devel-0.4.11-2.tar.bz2'
    
    100%[======================================>] 13,836      --.-K/s   in 0.01s
    
    2014-06-07 17:20:05 (1.20 MB/s) - `libproxy-devel-0.4.11-2.tar.bz2' saved [13836/13836]
    
    Unpacking...
    Package libproxy-devel requires the following packages, installing:
    libproxy1
    Package libproxy1 is already installed, skipping
    Package libproxy-devel installed
    Package openssl-devel is already installed, skipping
    Package zlib-devel is already installed, skipping
    Package coreutils is already installed, skipping
    Package sed is already installed, skipping
    Package libneon-devel installed
    
    201406071854TCYW03.png
    201406071854TCYW04.png
    201406071854TCYW05.png
    201406071854TCYW06.png
  2. アーカイブのダウンロードと展開

    sitecopy-0.16.6.tar.gzをダウンロードして展開します。

    $ mkdir -p src && cd src
    $ curl -sL http://www.manyfish.co.uk/sitecopy/sitecopy-0.16.6.tar.gz | tar zxf -
    
  3. configureの実行 アーカイブ中に含まれるconfigureスクリプトを実行します。
  4. $ cd sitecopy-0.16.6
    $ ./configure --with-libintl-prefix=/usr
    
    configureログ
    checking for gcc... gcc
    checking for C compiler default output file name... a.exe
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables... .exe
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether make sets $(MAKE)... yes
    checking for library containing strerror... none required
    checking for a BSD-compatible install... /bin/install -c
    checking for inline... inline
    checking for an ANSI C-conforming const... yes
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for socketpair... yes
    configure: debugging is enabled
    checking for GNU fnmatch... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for size_t... yes
    checking for off_t... yes
    checking for uname... CYGWIN_NT-6.1
    checking for int... yes
    checking size of int... 4
    checking for long... yes
    checking size of long... 4
    checking for long long... yes
    checking size of long long... 8
    checking for gcc -Wformat -Werror sanity... yes
    checking errno.h usability... yes
    checking errno.h presence... yes
    checking for errno.h... yes
    checking stdarg.h usability... yes
    checking stdarg.h presence... yes
    checking for stdarg.h... yes
    checking for string.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for size_t... (cached) yes
    checking size of size_t... 4
    checking how to print size_t... u
    checking for off_t... (cached) yes
    checking size of off_t... 8
    checking how to print off_t... lld
    checking for ssize_t... yes
    checking size of ssize_t... 4
    checking how to print ssize_t... d
    checking whether byte ordering is bigendian... no
    checking whether strerror_r is declared... yes
    checking for strerror_r... yes
    checking whether strerror_r returns char *... yes
    checking for snprintf... yes
    checking for vsnprintf... yes
    checking for ar... /bin/ar
    checking for ranlib... /bin/ranlib
    checking for neon-config... /bin/neon-config
    checking linking against neon... yes
    configure: incompatible neon library version 0.29.6: wanted 0.24 25 26 27 28
    configure: using bundled neon (0.28.2)
    checking for sys/time.h... yes
    checking for limits.h... yes
    checking for sys/select.h... yes
    checking for arpa/inet.h... yes
    checking for libintl.h... yes
    checking for signal.h... yes
    checking for sys/socket.h... yes
    checking for netinet/in.h... yes
    checking for netinet/tcp.h... yes
    checking for netdb.h... yes
    checking for sys/poll.h... yes
    checking for sys/limits.h... no
    checking for fcntl.h... yes
    checking for iconv.h... yes
    checking for timezone global... yes
    configure: LFS support unnecessary, off_t is not 32-bit
    checking for strtoll... yes
    checking for strcasecmp... yes
    checking for signal... yes
    checking for setvbuf... yes
    checking for setsockopt... yes
    checking for stpcpy... yes
    checking for poll... yes
    checking for fcntl... yes
    checking for getsockopt... yes
    checking whether stpcpy is declared... yes
    checking for library containing socket... none needed
    checking for library containing getaddrinfo... none needed
    checking for gai_strerror... yes
    checking for getnameinfo... yes
    checking for inet_ntop... yes
    configure: IPv6 support is enabled
    checking for working AI_ADDRCONFIG... yes
    checking for socklen_t... yes
    checking for struct tm.tm_gmtoff... no
    checking for struct tm.__tm_gmtoff... no
    configure: zlib not supported
    checking whether to enable ACL support in neon... no
    configure: SSL support is not enabled
    configure: Thread-safe SSL support is not enabled
    configure: Thread-safe SSL not supported
    configure: SOCKSv5 support is not enabled
    checking for krb5-config... none
    checking expat.h usability... yes
    checking expat.h presence... yes
    checking for expat.h... yes
    checking for XML_SetXmlDeclHandler in -lexpat... yes
    checking for XML_Size... yes
    checking for XML_Size... (cached) yes
    checking size of XML_Size... 4
    checking how to print XML_Size... ld
    configure: XML parser used: expat
    configure: WebDAV support is enabled
    checking for getopt_long... yes
    checking for strcasecmp... (cached) yes
    checking for strdup... yes
    checking for strsignal... yes
    checking for strerror... yes
    checking for memcpy... yes
    checking for setlocale... yes
    checking for nl_langinfo... yes
    checking return type of signal handlers... void
    checking for stdarg.h... (cached) yes
    checking for string.h... (cached) yes
    checking for strings.h... (cached) yes
    checking for sys/time.h... (cached) yes
    checking regex.h usability... yes
    checking regex.h presence... yes
    checking for regex.h... yes
    checking locale.h usability... yes
    checking locale.h presence... yes
    checking for locale.h... yes
    checking langinfo.h usability... yes
    checking langinfo.h presence... yes
    checking for langinfo.h... yes
    checking for stdlib.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for limits.h... (cached) yes
    checking for sys/select.h... (cached) yes
    checking for fcntl.h... (cached) yes
    checking for the third argument of getsockname... socklen_t
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking whether NLS is requested... yes
    checking for msgfmt... no
    checking for gmsgfmt... :
    checking for xgettext... no
    checking for msgmerge... no
    checking build system type... i686-pc-cygwin
    checking host system type... i686-pc-cygwin
    checking whether we are using the GNU C Library 2 or newer... no
    checking for ranlib... /bin/ranlib
    checking for simple visibility declarations... yes
    checking for stdint.h... yes
    checking for working alloca.h... yes
    checking for alloca... yes
    checking for stdlib.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for getpagesize... yes
    checking for working mmap... no
    checking whether integer division by zero raises SIGFPE... yes
    checking for inttypes.h... yes
    checking for unsigned long long int... yes
    checking for inttypes.h... (cached) yes
    checking whether the inttypes.h PRIxNN macros are broken... no
    checking for AIX... no
    checking minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    checking for ld used by GCC... /bin/ld
    checking if the linker (/bin/ld) is GNU ld... yes
    checking for shared library run path origin... done
    checking whether imported symbols can be declared weak... yes
    checking pthread.h usability... yes
    checking pthread.h presence... yes
    checking for pthread.h... yes
    checking for pthread_kill in -lpthread... yes
    checking for pthread_rwlock_t... yes
    checking for multithread API to use... posix
    checking argz.h usability... yes
    checking argz.h presence... yes
    checking for argz.h... yes
    checking for inttypes.h... (cached) yes
    checking for limits.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking sys/param.h usability... yes
    checking sys/param.h presence... yes
    checking for sys/param.h... yes
    checking for getcwd... yes
    checking for getegid... yes
    checking for geteuid... yes
    checking for getgid... yes
    checking for getuid... yes
    checking for mempcpy... yes
    checking for munmap... yes
    checking for stpcpy... (cached) yes
    checking for strcasecmp... (cached) yes
    checking for strdup... (cached) yes
    checking for strtoul... yes
    checking for tsearch... yes
    checking for argz_count... yes
    checking for argz_stringify... yes
    checking for argz_next... yes
    checking for __fsetlocking... no
    checking whether feof_unlocked is declared... no
    checking whether fgets_unlocked is declared... no
    checking for iconv... yes
    checking for working iconv... yes
    checking how to link with libiconv... -liconv
    checking for iconv declaration...
             extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
    checking for NL_LOCALE_NAME macro... no
    checking for bison... bison
    checking version of bison... 2.7.12, ok
    checking for long long int... yes
    checking for wchar_t... yes
    checking for wint_t... yes
    checking for intmax_t... yes
    checking whether printf() supports POSIX/XSI format strings... yes
    checking whether we are using the GNU C Library 2.1 or newer... no
    checking for stdint.h... (cached) yes
    checking for SIZE_MAX... yes
    checking for stdint.h... (cached) yes
    checking for CFPreferencesCopyAppValue... no
    checking for CFLocaleCopyCurrent... no
    checking for ptrdiff_t... yes
    checking stddef.h usability... yes
    checking stddef.h presence... yes
    checking for stddef.h... yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for asprintf... yes
    checking for fwprintf... yes
    checking for putenv... yes
    checking for setenv... yes
    checking for setlocale... (cached) yes
    checking for snprintf... (cached) yes
    checking for wcslen... yes
    checking whether _snprintf is declared... no
    checking whether _snwprintf is declared... no
    checking whether getc_unlocked is declared... yes
    checking for nl_langinfo and CODESET... yes
    checking for LC_MESSAGES... yes
    checking for windres... windres
    checking for CFPreferencesCopyAppValue... (cached) no
    checking for CFLocaleCopyCurrent... (cached) no
    checking whether included gettext is requested... no
    checking for GNU gettext in libc... no
    checking for GNU gettext in libintl... yes
    checking whether to use NLS... yes
    checking where the gettext function comes from... external libintl
    checking how to link with libintl... -lintl
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/neon/Makefile
    config.status: creating po/Makefile.in
    config.status: creating intl/Makefile
    config.status: creating config.h
    config.status: executing po-directories commands
    config.status: creating po/POTFILES
    config.status: setting ALL_LINGUAS in configure.in is obsolete
    config.status: creating po/Makefile
    configure: Configured sitecopy 0.16.6:
    
      Install prefix:        /usr/local
      Compiler:              gcc
      Frontend:              Console (executable named 'sitecopy')
      Supported protocols:   sftp/ssh rsh/rcp WebDAV FTP
      neon library:          included libneon (0.28.2)
      XML Parser:            expat
      SSL library:           SSL support is not enabled
      Internationalization:  Built using native support
    
    201406071854TCYW07.png
    201406071854TCYW08.png
    201406071854TCYW09.png
    201406071854TCYW10.png
    201406071854TCYW11.png
    201406071854TCYW12.png
    201406071854TCYW13.png
    201406071854TCYW14.png
    201406071854TCYW15.png
    201406071854TCYW16.png
  5. Makefileの修正

    configureスクリプトによって作成されたMakefileのまま、ビルドを行うとエラーになるため、Makefileを修正します。

    変更前

    $(TARGET): subdirs $(ALLOBJS)

    変更後

    $(TARGET): $(ALLOBJS)

    $ cp -p Makefile Makefile.orig
    $ vi Makefile
    $ diff Makefile.orig Makefile
    
    89c89
    < $(TARGET): subdirs $(ALLOBJS)
    ---
    > $(TARGET): $(ALLOBJS)
    
  6. sitecopyのビルド

    makeコマンドを実行して、sitecopyをビルドします。

    $ make
    
    ビルドログ
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/sites.o -c src/sites.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/sitefiles.o -c src/sitefiles.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/sitestore.o -c src/sitestore.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/rcfile.o -c src/rcfile.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/common.o -c src/common.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/nulldriver.o -c src/nulldriver.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/lsparser.o -c src/lsparser.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/ftp.o -c src/ftp.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/ftpdriver.o -c src/ftpdriver.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/davdriver.o -c src/davdriver.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/rshdriver.o -c src/rshdriver.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/sftpdriver.o -c src/sftpdriver.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o src/console_fe.o -c src/console_fe.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o lib/netrc.o -c lib/netrc.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o lib/basename.o -c lib/basename.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o lib/dirname.o -c lib/dirname.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o lib/rpmatch.o -c lib/rpmatch.c
    gcc -I. -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/locale\" -I./src -I./lib -g -O2 -I./lib/neon -o lib/yesno.o -c lib/yesno.c
    gcc -g -O2 -I./lib/neon  -o sitecopy.exe src/sites.o src/sitefiles.o src/sitestore.o src/rcfile.o src/common.o src/nulldriver.o src/lsparser.o src/ftp.o src/ftpdriver.o src/davdriver.o src/rshdriver.o src/sftpdriver.o src/console_fe.o -L./lib/neon -lneon  -lexpat -lintl  lib/netrc.o lib/basename.o lib/dirname.o  lib/rpmatch.o lib/yesno.o
    
     Compilation complete. Run 'make install' to install sitecopy.
     (You may need to become root to do this)
    
    201406071854TCYW17.png
    201406071854TCYW18.png
  7. sitecopyのインストール

    make installを実行して、sitecopyをインストールします。
    nls関係のインストール時にエラーになりますが、無視します。

    $ make install
    
    インストールログ
    Creating directories...
    /bin/sh ./mkinstalldirs /usr/local/bin /usr/local/share/sitecopy /usr/local/doc/sitecopy
    mkdir /usr/local/share
    mkdir /usr/local/share/sitecopy
    mkdir /usr/local/doc
    mkdir /usr/local/doc/sitecopy
    Installing sitecopy.exe executable...
    /bin/install -c sitecopy.exe /usr/local/bin/sitecopy.exe
    Installing data files...
    set -e; for f in doc/examplerc doc/changes.awk; do \
            /bin/install -c -m 644 ./$f /usr/local/share/sitecopy/`echo $f | sed 's/^doc\///'`; \
    done
    Installing documentation...
    set -e; for f in README NEWS THANKS doc/update.sh; do \
            /bin/install -c -m 644 ./$f /usr/local/doc/sitecopy/`echo $f | sed 's/^doc\///'`; \
    done
    Installing man page...
    /bin/sh ./mkinstalldirs /usr/local/share/man/man1
    mkdir /usr/local/share/man
    mkdir /usr/local/share/man/man1
    /bin/install -c -m 644 ./doc/sitecopy.1 /usr/local/share/man/man1/sitecopy.1
    for f in fr; do /bin/sh ./mkinstalldirs /usr/local/share/man/$f/man1; \
            /bin/install -c -m 644 ./doc/sitecopy.$f.1 \
                         /usr/local/share/man/$f/man1/sitecopy.1; done
    mkdir /usr/local/share/man/fr
    mkdir /usr/local/share/man/fr/man1
    
    sitecopy installation finished.
    
    /bin/sh: line 0: cd: po: No such file or directory
    Makefile:158: recipe for target 'install-nls' failed
    make: *** [install-nls] Error 1
    
    201406071854TCYW19.png
    201406071854TCYW20.png
  8. 動作確認

    ヘルプを表示させて、動作を確認します。

    $ sitecopy --help
    
    ヘルプ表示
    sitecopy 0.16.6: FTP WebDAV rsh/rcp sftp/ssh, debugging, cygwin platform.
    Usage: sitecopy [OPTIONS] [MODE] [sitename]...
    Options:
      -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:
         socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, cleartext
         Warning: cleartext displays (normally hidden) passwords in plain text
      -g, --logfile=FILE    Append debugging messages to FILE (else use stderr)
      -r, --rcfile=FILE     Use alternate run control file
      -p, --storepath=PATH  Use alternate site storage directory
      -y, --prompting       Request confirmation before making each update
      -a, --allsites        Perform the operation on ALL defined sites
      -k, --keep-going      Carry on an update regardless of errors
      -o, --show-progress   Display total percentage file transfer complete
      -q, --quiet           Be quiet while performing the operation
      -qq, --silent         Be silent while perforing the operation
      -n, --dry-run         Display but do not carry out the operation
    Operation modes:
      -l, --list            List changes between remote and local sites (default)
      -ll, --flatlist       Flat list of changes between remote and local sites
      -v, --view            Display a list of the site definitions
      -i, --initialize      Mark all files and directories as not updated
      -f, --fetch           Find out what files are on the remote site
      -e, --verify          Verify stored state of site matches real remote state
      -c, --catchup         Mark all files and directories as updated
      -s, --synchronize     Update the local site from the remote site
      -u, --update          Update the remote site
      -h, --help            Display this help message
      -V, --version         Display version information
    Please send feature requests and bug reports to sitecopy@lyra.org
    
    201406071854TCYW21.png
    201406071854TCYW22.png

    以上で、sitecopyのインストールは終了です。

sitecopyの設定

sitecopyの設定を行います。

  1. .sitecopyフォルダの作成

    sitecopyが使用する制御情報を保存するフォルダを作成します。

    $ mkddir -pm 0700 ~/.sitecopy
    
  2. .sitecopyrcの作成

    sitecopyでは、下記の設定項目を使用します。

    設定項目概要
    siteサイト名を指定します。
    serverリモートサーバーを指定します。
    usernameFTPユーザー名を指定します。
    passwordFTPパスワードを指定します。
    localローカル側のフォルダを指定します。
    remoteサーバー側のアップロードフォルダを指定します。
    statechecksumを指定するとミラーされたファイルの完全性がチェックされます。
    protocolftpを指定します。
    checkmovedローカル側で移動されたファイルをサーバー側でも移動します。
    permissionsファイルやフォルダのパーミッションもミラーします。
    excludeミラーから除外すファイルやフォルダを指定します。
    $ vi ~/.sitecopy
    
    site sitename
      server servername
      username username
      password userpasswd
      local ~/html/
      remote /
      state checksum
      protocol ftp
      checkmoved
      permissions all
      exclude "RCS"
    
  3. ミラーリング

    初めて実行する場合、sitecopyを初期化します。

    $ sitecopy -ai
    
    201406071854TCYW23.png

    ミラーリングを実行します。

    $ sitecopy -au
    
    201406071854TCYW23.png

    以上で、sitecopyの設定は終了です。
    ファイルを更新した後、sitecopyを実行するだけで更新されたファイルのみをアップロードできるようになります。