SSH LocalCommand Странность - Почему у меня есть фона rsync?

cd в каталог, где находятся каталоги tomcat _ * (они не должны быть все в одном каталоге ) и выполните следующую команду:

find . -path "./*tomcat_*managetest.class"

Это будет соответствовать, например:

./b/tomcat_c/managetest.class
./tomcat_a/managetest.class
./tomcat_a/b/managetest.class

Но не ./ b / c / managetest.class . Сообщите мне, должен ли managetext.class находиться внутри tomcat _ * .

Теперь полная команда для печати также измененной даты:

find . -path "./*tomcat_*managetest.class" -exec stat -c "%n %y" {} \;

Вы можете выбрать поля, которые вас больше интересуют (например, год или время) с помощью awk, написав в конце приведенной выше команды что-то вроде | awk '{print $ 1 "" $ 2 "" $ 3}' или, как предложил gogoud, вместо использования exec вы можете использовать команду find printf .

4
10.08.2018, 15:42
1 ответ

Возможный ответ в этом блоге:

Finally, there is something of an annoyance with ControlMaster, and it’ll probably confuse you mightily when you first come across it. Because all of your SSH sessions are multiplexed down a single TCP connection initiated by the first SSH session, that first session must stay alive until all of the other sessions are complete. This problem will manifest itself as an apparent “hang” when you log out of the remote session that is acting as the master — instead of getting your local prompt back, SSH will just sit there. If you Ctrl-C or otherwise kill this session, all of the other sessions you’ve got setup to that server will drop, so don’t do that. Instead, when you logout of all the other sessions, the master will then return to the local prompt.

Я решил аналогичную проблему, добавив -S none в список параметров ssh:

LocalCommand rsync --update -a -e "ssh -o PermitLocalCommand=no -S none" ~/.cfg/ dns:.cfg/
1
27.01.2020, 21:01

Теги

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