Last active
August 29, 2015 14:17
-
-
Save ngelik/c9fc80a6763b25b0c4ea to your computer and use it in GitHub Desktop.
Example of sshfs usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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