Posts Tagged ‘dropbox’

Remove “conflicted copy” files in your Dropbox folder

October 13, 2015 Leave a comment

Here is a quick solution to remove conflicted copies:

#!/usr/bin/env bash

# just print
find . | grep "conflicted copy 2015" | while read i; do echo $i; done

# print and DELETE
#find . | grep "conflicted copy 2015" | while read i; do echo $i; /bin/rm "$i"; done

Put it in your ~/Dropbox folder and launch it. First it will just print the conflicted copies. If you want to get rid of these files (verify!), then uncomment the last line.

The string “2015” is added to narrow the produced list. But normally “conflicted copy” should be enough.

Categories: bash Tags: ,

dropbox: command-line interface

September 12, 2015 Leave a comment

I wanted to test the status of my Dropbox client from the terminal. Actually, I wanted to write a script that executes an action when my Dropbox folder is fully synced. So I wanted to test the status if it’s “working” or “synced”.

I found the solution here. It turned out that Dropbox has an official command-line script that can do this and much more. First, get it:

wget -O ~/
chmod u+x ~/
~/ status

This is a Python script, written in Python 2, thus I modified the first line to be “#!/usr/bin/env python2“.

This script can do several things for you:

Dropbox command-line interface


Note: use dropbox help  to view usage for a specific command.

 status       get current status of the dropboxd
 help         provide help
 puburl       get public url of a file in your dropbox
 stop         stop dropboxd
 running      return whether dropbox is running
 start        start dropboxd
 filestatus   get current sync status of one or more files
 ls           list directory contents with current sync status
 autostart    automatically start dropbox at login
 exclude      ignores/excludes a directory from syncing
 lansync      enables or disables LAN sync

Some years ago I wrote a simple script to get the public URL of a file in my Dropbox folder. This script can do that too with the “puburl” command.

Categories: bash, python Tags: , ,

dropbox: remove conflicted copies

January 3, 2015 Leave a comment

If you have Dropbox installed on several machines, sometimes one of the clients litter your Dropbox folder with conflicted copies. Their number can be up to hundred(s). How to get rid of them?

First, locate the conflicted copies:

$ cd ~/Dropbox  # or wherever your Dropbox folder is
$ find . | grep "conflicted copy"

Investigate the result and make sure they can be deleted.

# one more check:
$ find . | grep "conflicted copy" | while read i; do echo $i; done

# if you are absolutely sure, delete them:
$ find . | grep "conflicted copy" | while read i; do echo $i; \rm "$i"; done

Notice that “$i” is between quotes since these filenames contain spaces.

Categories: bash Tags: ,

[manjaro] install Dropbox

November 2, 2014 Leave a comment

You want to install Dropbox on Manjaro.

Visit the official download page and follow the instructions under the section “Install Dropbox via command line”. Everything is explained there.

Later, Dropbox may complain that it cannot monitor the filesystem correctly. It happens when you have lots and lots of files in your Dropbox folder. Here is the fix:

# open this file for edit:
$ sudo vim /etc/sysctl.d/99-sysctl.conf
# and add this line:
fs.inotify.max_user_watches = 100000
# then reload the kernel parameters:
sudo sysctl --system

Notice that this file’s location differs from Ubuntu’s.

This tip is from here.

Categories: manjaro Tags:

ménage de printemps (spring cleaning)

March 22, 2014 Leave a comment

My Dropbox folder was at 98.5%, so it was time to do some cleanup. Which directories are the largest? Which files are the largest?


alias top10dirs='du -hsx * | sort -rh | head -10'
alias top10files='find . -type f -print0 | du -h --files0-from=- | sort -hr | head -n 10'

The first one shows the top 10 largest directories, while the second one prints the top 10 largest files. Directory and file sizes are shown in a human-readable format.


$ top10dirs 
60M     20090629-deploy
60M     20090327-deploy
56M     kgm
55M     exist-deploy-v3-20100710
55M     exist-deploy-v3-20100521
$ top10files 
60M     ./20090629-deploy/
60M     ./20090327-deploy/
55M     ./exist-deploy-v3-20100710/
55M     ./exist-deploy-v3-20100521/
49M     ./exist-deploy-v3-20100409/


  • top10dirs is from here
  • for top10files I wrote a Python script, but reddit user farsass pointed out that it can be solved easier in the shell

Linux host, Windows guest, shared Dropbox folder

February 16, 2014 Leave a comment

My primary operating system is Linux but since I need to work with Powerpoint too, I installed Windows 7 in VirtualBox. Under Windows I prepare my presentations but I want them synchronized on all my machines. For the synchronization I was using Dropbox.

I had Dropbox on Linux (host machine) and on Windows (guest machine) too. When I edited a file under Windows, Dropbox synced it to the Linux host too (the Windows client uploads it to the cloud; the Linux client downloads it from the cloud). It worked fine, though it was not not optimal. If I didn’t use the Windows guest for a long time, then after a boot I had to wait some time till Dropbox synced everything and I could start working only after that.

However, something happened to the Windows Dropbox client recently. Maybe it’s a bug, I don’t know, but the Dropbox client in my Windows guest became terribly slow. It keeps syncing but it doesn’t upload the changes, or I need to wait an hour or so to upload a file 1 MB of size. This is ridiculous and unacceptable. Note that I dind’t experience similar issues with the Linux client.

How to have a synchronized folder between a Linux host and a Windows guest without a Dropbox client on the guest?

First I made sure that my Dropbox folders were synced between the host and the guest. After this I uninstalled Dropbox on Windows and removed the C:\Dropbox folder entirely. Since it was synced with the Linux host, I had an exact copy of the Dropbox folder on Linux. Then shut down the Windows guest.

Here ( you can find an excellent post on how to set up a shared folder between a Linux host and a Windows guest. On the Linux host I shared my Dropbox folder ($HOME/Dropbox) that appears now as a new drive in the Windows guest (G:\ in my case). Now, if I modify something under Windows, it will be visible immediately in the Linux file system that the Dropbox client on Linux will notice and sync.

With this I could solve two problems. First, when I boot up the Windows guest, I don’t need to wait for the Dropbox client to sync. Second, if I change something under Windows, it is still synced to the Dropbox cloud, though I have no Dropbox client on Windows anymore.

SpiderOak: a great Ubuntu One alternative

July 31, 2013 Leave a comment

Dropbox is awesome but it has a drawback. It treats symbolic links in a terrible way. So, if you want to sync a directory between several Linux machines AND you want to use symbolic links in this common directory, then forget Dropbox. I also use Windows machines with Dropbox, and my symbolic links were always f* up.

To avoid this problem, I decided to use Ubuntu One next to Dropbox. In the “Ubuntu One” directory I put content that I wanted to share between my Linux machines. Ubuntu One simply ignores symbolic links, thus I used a script on each machine to recreate the links. It worked well until Ubuntu One refused to start on my home machine… It is written in Python (that I love by the way), but the libraries somehow got messed up and Ubuntu One quit with an error. F* awesome!

So, what should I use instead of Ubuntu One? The alternative must treat symbolic links normally (or, to be safe, just ignore them), otherwise it’s useless for me.

And that’s how I found SpiderOak. Basically it works just like Dropbox, but similarly to Ubuntu One it nicely ignores symbolic links.


Get every new post delivered to your Inbox.

Join 85 other followers