You are currently viewing a single post of this guestblog.

Click here to go back the complete page. I would be glad to hear your comments, so don’t hesitate to leave me your feedback below. It will appear on the main guestblog page.

in categories  linux  permalink:  216   posted on 21.02.2013 24:15
From Yorik

Dropbox check script

If you are using dropbox on linux, be aware that there are several reports of dropbox "loosing" some of your files (the file still exists, but it has 0Kb size). The causes of this problem seem not very clear...

Anyway, I made this little script that checks your dropbox folder if everything is okay:

if [ -z "$1" ]
    find /home/yorik/Dropbox/* -size 0 -type f
    if [ -n "$(find /home/yorik/Dropbox/* -size 0 -type f)" ]
        notify-send -i important "Dropbox Warning" "0-byte files found"
        play /home/yorik/.sound/nuclear-alarm.wav

To use it, just put the above text in a new file, adjust the paths /home/yorik/ to yours, save it and make it executable. If you run it without options, it will prin a list of 0-byte files found in your dropbox folder. If you run it with any kind of argument (for example checkdropbox -n), it will show an alert on your desktop if any 0-byte file is found. I use it that way in a cron job that runs every hour, that I set by adding the following line in crontab (do crontab -e in a terminal):

0 *  * * * env DISPLAY=:0 /home/yorik/bin/checkdropbox -n

the "env DISPLAY=:0" is needed when you want to lauch graphical applications from crontab...

First and foremost, your name:

And your message:

To publish it, just press this ...