rsync- სგან სიმბოლური ბმულების გამორიცხვა ზედმეტი შეტყობინების გარეშე

BASH

BASH хорош для этой работы, потому что BASH может легко генерировать алфавит, используя {a..z} и BASH может ввести один символ без необходимости нажимать ENTER

$ cat guesschar.bash 
c=$(echo {a..z} | tr -d ' ')
x=${c:$((RANDOM%26+1)):1}
while read -n1 -p'guess the char: ' ; do
        echo
        if [[ $REPLY < $x ]] ; then echo too low...
        elif [[ $REPLY > $x ]] ; then echo too high...
        else break
        fi
done
echo $x ... 'hit!'
$ bash guesschar.bash 
guess the char: m
too high...
guess the char: f
too low...
guess the char: j
too low...
guess the char: k
k ... hit!
4
28.05.2018, 11:49
3 ответа

Puede usar --files-frompara definir la lista de archivos para sincronizar y usar findpara excluir enlaces simbólicos:

rsync --files-from=<(find. ! -type l -print). TARGET/
4
27.01.2020, 20:59

Si no desea ver mensajes sobre ningún archivo omitido, puede usar --info=skip0si su versión de rsyncno es demasiado antigua.

Si no desea ver mensajes en enlaces simbólicos omitidos, pero desea los mensajes si se omite cualquier otro archivo, desafortunadamente rsynclas opciones de control de salida no parecen sea ​​fino -lo suficientemente granulado para eso.

Consulte rsync --info=helppara obtener una lista de las cosas que puede ajustar en la salida rsync.

7
27.01.2020, 20:59

Попробуйте добавить это после команды rsync:

| grep -v "skipping non-regular file"

Если это единственные вещи, генерирующие эти сообщения, они будут отфильтрованы. Вы даже можете сделать "^skipping", если он находится в начале строки.

1
27.01.2020, 20:59

Теги

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