August 2010

« September 2010 July 2010 »

Aug

18

2010

Cleaning the Dropbox Cache

I use Dropbox as a convenient way to keep an online backup of my files as well as sync them between my computer at church and my computer at home. 

Basically, I put my "Documents" folder inside the "Dropbox" folder, and then immediately as soon as I edit a file, it automatically uploads it online, and then synchronizes it with my other computer at home/work. It is a constant backup system. No more emailing files, ever! Pretty cool, eh?

With such constant changes happening, however, the Dropbox cache can get pretty large pretty quickly--a few gigs in a few days. So, rather than deleting it manually, I did what any other nerd normal person might do: I wrote a script to do it for me.

I put it up here in case anybody else wants to use it as well. I find it useful, I hope you will too.

  1. Install cygwin (standard options are fine)
  2. Download my cleanDropboxCache.sh and put it in a permanent location
  3. Open up "Task Scheduler"
  4. Create a new basic task to run daily
  5. Set the "Action" to "Run a Program"
    • Program/script: "c:\cygwin\bin\sh.exe"
    • Add arguments: <insert path to cleanDropboxCache.sh> (ex: "d:\users\matt\bin\cleanDropboxCache.sh")

And you should be good to go! Enjoy. =)

#!/bin/sh

UsersDir="`echo $USERPROFILE | sed -e 's/\\\\/\//g'`/.."

# Look for users
for user in "$UsersDir"/*; do 

 if [ -d "$user" -a "$user" != "$UsersDir" ]; then

  DropboxDir="$user/Application Data/Dropbox/cache"
  
  # Make sure they have a Dropbox Cache to clear
  if [ ! -d "$DropboxDir" ]; then
   continue
  fi

  echo "Found Dropbox Dir: $DropboxDir"
  
  cd "$DropboxDir"
  
  thisMonth=`date +%m`
  thisDate=`date +%d`
  thisYear=`date +%Y`
  
  # Search listing of cache directories to find old ones
  for dir in 20*-*-*; do

   if [ ! -d $dir ]; then
    continue
   fi
   
   year=`echo $dir  | awk -F- '{ print $1 }'`
   month=`echo $dir  | awk -F- '{ print $2 }'`
   date=`echo $dir  | awk -F- '{ print $3 }'`
  
   if [ $year -le $thisYear ]; then
  
    if [ $month -le $thisMonth ]; then
  
     # Deletes directories previous to 'yesterday'
     if [ $date -lt $thisDate ]; then
  
      echo "Deleting $dir"
      rm -fr $dir
  
     fi
    
    fi
   
   fi
  
  done

 fi

done


Aug

18

2010

Producing a Stir

Godet in his comments on John the Baptist in Luke 3:

What a stir would be produced at the present day by the preaching of a man, who, clothed with the authority of holiness, should proclaim with power the speedy coming of the Lord, and His impending judgment! 

Indeed. It is easy to talk about and explain what John said to the people back then. It is much harder to be a John the Baptist in the present and allow the word of God come alive before its hearers and address them!

Aug

22

2010

A Highway of Salvation

Luke 3:4-6 - "A Highway of Salvation". Really interesting study I enjoyed and wanted to share on John the Baptist as "the voice in the wilderness".

Aug

31

2010

" Too Bad for Me "

I think the NET Bible messed up on Isaiah 6:5

I said, "Too bad for me! I am destroyed"

What? Is that it?! 

« September 2010 July 2010 »

Matt Hauck (郝柏昇)

A once enemy now son, forgiven and freed by Jesus' blood, adopted and called by grace for glory.   (more...)