Live data from Hacker News

My one-liner Linux Dropbox client

lpan.io

1–10 of 165 posts

Re: My one-liner Linux Dropbox client

#2
I did something similar actually. I have my 1Password vault on Dropbox so I can get it on my Linux machines.

Dropbox has some nice python modules/libraries to support me, so I’m able to download the directory as a zip and extract it in memory.

It’s stupid and unidirectional, but I’m sure more talented people are able to build a bidirectional python Dropbox client in no time, with inotify since python has bindings for this too.

Re: My one-liner Linux Dropbox client

#7
I hadn't seen entr before! My first glance at your one-liner:

find $ORG_DIR | entr -r rclone sync -v $ORG_DIR $REMOTE:org

is that find will enumerate all your existing files, but starting a new one won't get picked up.

It seems like entr is prepared though, and you should just pass in -d. In fact why use find at all, if you want to rsync the directory?

Re: My one-liner Linux Dropbox client

#8
post #6

It looks like there might be a bug. What happens when you add a new file? A quick scan of the entr help text suggests you should be using the -d flag.

Ha! I took too long to format my response :). The entr examples from [1] seem to do the same (ls *.rb for example).

[1] http://eradman.com/entrproject/

Re: My one-liner Linux Dropbox client

#9
post #7

I hadn't seen entr before! My first glance at your one-liner: find $ORG_DIR | entr -r rclone sync -v $ORG_DIR $REMOTE:org is that find will enumerate all your existing files, but starting a new one won't get picked up. It seems like entr is prepared though, and you should just pass in -d. In fact why use find at all, if you want to rsync the directory?

Huge additional plus, entr does not rely exclusively on inotify, it is also 'BSD kqueue wrapper. It is the only command line utility that I found that allows cross platform (linux/BSD) scripting with file system events.

I have few scripts that rely on entr and I am always sure they are OS agnostic.

Re: My one-liner Linux Dropbox client

#10
post #7

I hadn't seen entr before! My first glance at your one-liner: find $ORG_DIR | entr -r rclone sync -v $ORG_DIR $REMOTE:org is that find will enumerate all your existing files, but starting a new one won't get picked up. It seems like entr is prepared though, and you should just pass in -d. In fact why use find at all, if you want to rsync the directory?

I didn't know about entr as well but I'm using fswatch which is largely similar and portable as well, supporting not only Linux and BSD but also non-WSL Windows and Solaris too, and leveraging the Filesystem Event API on macOS.

https://github.com/emcrisostomo/fswatch

Post reply on HN