rsync не работает с несколькими SRC

Если вы хотите получить что-то дешевое, что просто печатает шестнадцатеричные данные в том виде, в каком они появляются вы можете использовать этот perl скрипт:

perl -e '$| = 1; $i = 1;
while(1){
 sysread(STDIN,$ch,1) or exit;
 printf "%02x%s",ord($ch),$i++%16==0?"\n":" ";
}'

А если вы действительно хотите прочитать до блока и запустить hexdump:

perl -e '$| = 1; $i = 1; $rin = ""; vec($rin, fileno(STDIN), 1) = 1;
open(F,"|hexdump -C") or die;
while(1){
 $nfound = select($rout=$rin, undef, undef, 0);
 if($nfound==1){
  sysread(STDIN,$data,999) or exit;
  syswrite(F,$data) or die;
 }else{
  close(F);
  open(F,"|hexdump -C") or die;
  select($rout=$rin, undef, undef, undef);
 }
}'
2
11.06.2018, 09:47
1 ответ

La versión macOS de rsyncno admite múltiples fuentes remotas. Contraste las líneas para fuentes remotas en la página de manual de macOS:

rsync [OPTION]... [USER@]HOST:SRC [DEST]
rsync [OPTION]... [USER@]HOST::SRC [DEST]

Con los de fuentes locales:

rsync [OPTION]... SRC [SRC]... DEST
rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST

Y con los de la página de manual de Ubuntu para fuentes remotas:

Access via remote shell:
 Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
 Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

La falta de puntos suspensivos en el primer conjunto indica que la versión macOS de rsyncno admite varias ubicaciones de origen remotas.

En Ubuntu 16.04:

~ rsync --version
rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.

macOS rsynces una antigüedad. Actualizar con homebrew o similar:

~ brew info rsync
rsync: stable 3.1.3 (bottled)
Utility that provides fast incremental file transfer
https://rsync.samba.org/
/usr/local/Cellar/rsync/3.1.3_1 (9 files, 756.1KB) *
  Poured from bottle on 2018-06-11 at 12:38:53
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/rsync.rb
==> Dependencies
Build: autoconf ✔
4
27.01.2020, 21:58

Теги

Похожие вопросы