Auto Backup using Dropbox in Linux/Mac

I had some folders on my disk which I wanted to keep a copy online as a backup and for viewing from other places. Its not always possible to save all the essentials in the drop box folder itself to be auto backed up. Thus I wrote a very small script which does this for me. All it does is read all the folders which needs to be backed up from the text file “dropboxFolders.txt” and copy them to dropbox folder. The rest is done by dropbox scripts. Hence I expect the dropbox program to be running always in the background. So here is the script:

while read line
from=`echo "$line" | cut -d":" -f1`
to=`echo "$line" | cut  -d":" -f2`
echo $from" to "$to
mkdir -p "$dropboxFolder$to"
cp -R "$from" "$dropboxFolder$to"
done <$foldersInfo

The file dropboxFolders.txt should be in the format :. Here is an example of the file:


And now all you need to do is cron the shell script file as in the blog post on Automatic Command Archive

, ,

  1. No comments yet.
(will not be published)