Skip to content

Instantly share code, notes, and snippets.

@ngelik
Last active August 29, 2015 14:17
Show Gist options
  • Save ngelik/c9fc80a6763b25b0c4ea to your computer and use it in GitHub Desktop.
Save ngelik/c9fc80a6763b25b0c4ea to your computer and use it in GitHub Desktop.
Example of sshfs usage
#!/bin/sh
mount_dir=/mnt/artifactory/
remote_dir=/
local_dir=/opt/artifactory_mirror/
art_server=user@ip
port=22
passw=your_pws
chown_permissions=your_user:your_group
echo ${passw} | sshfs ${art_server}:${remote_dir} ${mount_dir} -p ${port} -o password_stdin -o allow_other
ls -l ${mount_dir}
rsync -ravP ${mount_dir} ${local_dir}
chown -R ${chown_permissions} ${local_dir}
echo 'SYNC completed'
fusermount -u ${mount_dir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment