Live data from Hacker News

My one-liner Linux Dropbox client

lpan.io

71–80 of 165 posts

Re: My one-liner Linux Dropbox client

#71

Earlier quoted context omitted.

In fairness, it's pretty difficult (read: impossible) to enable full-disk encryption on an NVME drive (read: most Ultrabooks including the Dell XPS "Developer Edition.") https://www.dell.com/community/Linux-Developer-Systems/XPS-1...

Full-disk encryption usually means encryption at the block layer below the filesystem. It doesn't actually have to cover the full disk. There is almost always at least one unencrypted partition on machines with full-disk encryption, since the boot loader and then the decryption routine have to be launched from somewhere. And yes, OEM recovery partitions or similar laptop-specific needs are another case. Full-partitio…

I use full-disk encryption on my old thinkpad. As in, the whole disk is encrypted, from first sector to last. There isn't even a MBR or a partition table on it! I boot the laptop from my USB stick which contains the kernel and initrd. That's what I call full-disk encryption ;)

Re: My one-liner Linux Dropbox client

#72
post #31

.... Except, a file added to your dropbox will only appear in your local box the next time you create a local file -- there is nothing to wake the local entr when a file is remotely added to dropbox.

Could write a little script to add then delete a temp file on some chron job or at login or something.

Re: My one-liner Linux Dropbox client

#73

Dropbox will work if you just create a local loopback file for an ext4 filesystem and mount the Dropbox folder on it.

The above is a great answer.

To expand on this (from some googling). All of this requires root.

1) Create a sparse file (actual size depends on usage)

  truncate -s 100G /home/zzz/Dropbox.image
2) Create a ext4 filesystem on it

  mkfs.ext4 -m0 /home/zzz/Dropbox.image
3) Mount it as a loopback file system

  sudo mount /home/zzz/Dropbox.image /home/zzz/Dropbox-fs
4) Create / Copy your dropbox folder to Dropbox-fs

  sudo mkdir /home/zzz/Dropbox-fs/Dropbox
  sudo chown -R zzz.zzz /home/zzz/Dropbox-fs/Dropbox
  cp -r /home/zzz/Dropbox-original /home/zzz/Dropbox-fs/Dropbox
5) Start Dropbox and point it to the new location

6) If we want to mount this automatically at login. Adding it to /etc/fstab may not work because of encryption.

But perhaps some script at login to mount it will work. For example, we can create a script at /usr/local/bin/mountDB.sh and then add a line to /etc/sudoers

  zzz ALL=(root) NOPASSWD: /usr/local/bin/mountDB.sh
Then somehow call this script at login of user zzz.

Re: My one-liner Linux Dropbox client

#75
post #15
post #13

> Recently, the proprietary Dropbox Linux client dropped support for all Linux file systems except unencrypted ext4. What the heck. Anyone has more information about that? Any announcement? And why would it fail to work on an encrypted (LUKS?) ext4 FS when encryption seemed to me to sit below the filesystem (since AFAIK ext4 doesn't support encryption itself)?

I too was a bit surprised by that statement. But according to Dropbox, full disk encryption should work fine. ”If you received a notification on Linux and you are running ext4, it may be because you are also running ecryptfs. ecrypfts is not supported. However, we support full disk encryption systems, such as LUKS for Linux users.” Source: https://www.dropboxforum.com/t5/Error-messages/Dropbox-clien...

Perfect, thank you for the -forum- link! :)

Re: My one-liner Linux Dropbox client

#76

I setup Syncthing [1] to do the same for my vimwiki folder. It was surprisingly easy, and doesn't require any external storage services. And it can even automatically sync files without internet, over the local network. [1] https://syncthing.net/

Just had a look, definitely looks amazing especially this particular feature for ignoring files [1]. I've been waiting so long for this in Dropbox.

[1] https://docs.syncthing.net/users/ignoring.html

Re: My one-liner Linux Dropbox client

#77

I setup Syncthing [1] to do the same for my vimwiki folder. It was surprisingly easy, and doesn't require any external storage services. And it can even automatically sync files without internet, over the local network. [1] https://syncthing.net/

I've used Syncthing and it's excellent. But for me, the lack of a mobile app was a dealbreaker. Even though it's not open source, I switched to Resilio Sync[1] (formerly known as btsync). It ticks all the other boxes, and just works amazingly well. I want to support them so I sprang for the $20 one time Pro license which adds selective sync and a few other nice features.

[1] https://www.resilio.com/individuals/

Re: My one-liner Linux Dropbox client

#78
post #3

Not really the same, but this reminds me of the top comment of the Dropbox announcement: https://news.ycombinator.com/item?id=8863

Why does someone have to bring up this eleven-year-old comment any time file synchronisation or Dropbox is mentioned? Dropbox is now broken for certain Linux configurations and someone had a bit of fun writing a shell one-liner to replicate some of its functionality. Meanwhile, the original eleven year old comment was partly a throwaway remark that it didn't do anything he could not do already which means it wasn't i…

> any time file synchronisation or Dropbox is mentioned

This is one of the most relevant topics you could quote it on, really. The post is tackling one-way sync and calling it a rough equivalent to Dropbox.

Re: My one-liner Linux Dropbox client

#79
The true workhorse behind this one-liner is inotify(Linux) or FSEvents(Mac) API. Not sure what is the Windows equivalent.

If your favorite language has access to those, then you can basically build your own file syncing client.

Re: My one-liner Linux Dropbox client

#80
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?

It's mentioned on reddit, that passing the -r flag will pick up new files, right? Link @https://www.reddit.com/r/linux/comments/a92m1u/comment/ecgqf...

EDIT Oh I see what you're saying; that's confusing, though, how's it supposed to work in the first place, then?? :))

Post reply on HN