■ Ubuntu での install 操作の例
sudo apt -y update sudo apt -y install sshfs
mkdir /mnt chown <ユーザ名> /mnt sudo gpasswd -a <ユーザ名> fuse sshfs -o intr -o sshfs_sync <リモートマシンのユーザ名>@<リモートマシン名>:/directory /mnt
fusermoount -u /mnt
.bashrc などに記述しておく. マウントが途切れていたら再マウントしている
if [ ! -f /tmp/www_done ]; then sshfs -o intr -o sshfs_sync hoge@www.hoge.com:/var/www /home/ubuntuuser/www touch /tmp/www_done else if [ ! -f /home/ubuntuuser/www/index.html ]; then sshfs -o reconnect -o intr -o sshfs_sync hoge@www.hoge.com:/var/www /home/ubuntuuser/www fi fi