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:

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

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...