tweet:2015:0330_01
sshとcron
Backupを取得するに際して、Backupを元々のServerに置いておいたら、Disk破損の時に一気に死ぬ。 で、そんな事態は救われないので、BackupをRemoteに置いておくために、Backup Scriptまで作ったわけだが、Serverの内側でcronなどでBackupを取得するのは設定ミスとか管理の分散とかが起こってうれしくない。 というわけで、remoteからsshを利用してBackupを取得するようにscriptを作ったのだが、
Pseudo-terminal will not be allocated because stdin is not a terminal.
などといいうErrorが出た。で、これはptyの割り付けないremoteからのコマンドは実行できないということでsshが吐き出すErrorである。
しかし、shell scriptには-t
は記載されていて、ちゃんと動くはずだとどはまりをしたわけで…
で、困りに困って調べてみたら、出てました。man ssh
-t Force pseudo-tty allocation. This can be used to execute arbitrary screen-based pro- grams on a remote machine, which can be very useful, e.g. when implementing menu ser- vices. Multiple -t options force tty allocation, even if ssh has no local tty.
よく見たら、Multiple -t options force tty allocation, even if ssh has no local tty.
だそうな。
要するに、-t -t
としろと。
わかりにくいからメモにしておく。
教訓は、RTFM … orz.
tweet/2015/0330_01.txt · 最終更新: 2015/03/30 11:28 by 127.0.0.1