Skip to content

Instantly share code, notes, and snippets.

@ngelik
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save ngelik/c9fc80a6763b25b0c4ea to your computer and use it in GitHub Desktop.

Select an option

Save ngelik/c9fc80a6763b25b0c4ea to your computer and use it in GitHub Desktop.

Revisions

  1. ngelik revised this gist Mar 15, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions sshfs_sync.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    #!/bin/sh

    mount_dir=/mnt/artifactory
    mount_dir=/mnt/artifactory/
    remote_dir=/
    local_dir=/opt/artifactory_mirror
    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} --delete-after
    rsync -ravP ${mount_dir} ${local_dir}
    chown -R ${chown_permissions} ${local_dir}
    echo 'SYNC completed'

  2. ngelik created this gist Mar 15, 2015.
    17 changes: 17 additions & 0 deletions sshfs_sync.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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} --delete-after
    chown -R ${chown_permissions} ${local_dir}
    echo 'SYNC completed'

    fusermount -u ${mount_dir}