dooblem / bsync

Bidirectional Synchronization using Rsync
GNU General Public License v3.0
289 stars 61 forks source link

On macOS, how do I know if I have GNU Find installed? #35

Closed tomachinz closed 4 years ago

tomachinz commented 6 years ago

If I type find I get a find. It looks like I have one installed via Brew.

/u/l/bin ❯❯❯ ls -la find
lrwxr-xr-x  1 tom  access_bpf  34  2 Sep  2016 find -> ../Cellar/findutils/4.6.0/bin/find

I ask before when I try to run bsync I get error:

zsh: /usr/local/bin/bsync: bad interpreter: /usr/bin/python3: no such file or directory

/u/l/bin ❯❯❯ brew install python3                                                                                                                                                                                                                                              ✘ 127
Error: python 2.7.14_3 is already installed
To upgrade to 3.6.5, run `brew upgrade python`

/u/l/bin ❯❯❯ bsync
zsh: /usr/local/bin/bsync: bad interpreter: /usr/bin/python3: no such file or directory
[tom@13inch.local:/usr/local/bin]
/u/l/bin ❯❯❯ python                                                                                                                                                                                                                                                            ✘ 127
Python 2.7.10 (default, Feb  7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> ^D
[tom@13inch.local:/usr/local/bin]
/u/l/bin ❯❯❯ python3
Python 3.6.5 (default, Mar 30 2018, 06:42:10)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
dooblem commented 5 years ago

Hi @tomachinz

Sorry for the (very) late response.

I corrected the "shebang" at the top of the script (first line of the script). Can you give it a try (it should be more portable).

tomachinz commented 4 years ago

Marvellous! It seems to be working. I also use this to sync my music library!

 ➜  bin which bsync
/usr/local/bin/bsync
 ➜  bin ls -la /usr/local/bin/bsync
-rwxr-xr-x  1 tom  admin  31755 11 Jul 04:26 /usr/local/bin/bsync
 ➜  bin bsync
Usage: bsync [options] DIR1 DIR2

    DIR can be user@sshserver:DIR
    -v      Verbose
    -i      Ignore permissions
    -b      Batch mode (exit on conflict)
    -p PORT     Port for SSH
    -o SSHARGS  Custom options for SSH

Many thanks!

tomachinz commented 4 years ago

(base) ➜ Music bsync "/Volumes/3tb-HFS/4TB-Backup/Music Drive/Music/iTunes/iTunes Media/Music/" "/Volumes/4TB/4TB/Music Drive/Music/iTunes/iTunes Media/Music/" Error: local GNU find not found. (On OSX, you can download it with 'brew install findutils')

tomachinz commented 4 years ago
(base) ➜  Music brew install findutils
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/findutils-4.7.0.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/3c609b729a1dc859459282a856ff6c164cd8388e531dad4e58c8d4c7acb670fb?response-content-disposition=attachment%3Bfilename%3D%22findutils-4.7.0.mojave.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvM
######################################################################## 100.0%
==> Pouring findutils-4.7.0.mojave.bottle.tar.gz
...
(base) ➜  Music bsync "/Volumes/3tb-HFS/4TB-Backup/Music Drive/Music/iTunes/iTunes Media/Music/"   "/Volumes/4TB/4TB/Music Drive/Music/iTunes/iTunes Media/Music/"
Loading filelists...
/Volumes/3tb-HFS/4TB-Backup/Music Drive/Music/iTunes/iTunes Media/Music/ has no permission support (fat?). Ignoring permissions.
Old filelist not found. Starting with empty history.