title: latexmk - running bash command to stop Dropbox syncing
body: <p>I am using latexmk to compile my LaTeX thesis.  I keep the thesis on my Dropbox, and as the dozens-to-hundreds of .aux and associated files are created, Dropbox indexing induces a significant overhead.</p>
  
  <p>I thus want to insert the following bash script before compilation starts to stop Dropbox:</p>
  
  <pre><code>#!/usr/bin/env bash
  dropbox_pid="$echo $(pgrep Dropbox)"
  kill -STOP $dropbox_pid
  </code></pre>
  
  <p>and correspondingly, to restart Dropbox at the end, I would like:</p>
  
  <pre><code>#!/usr/bin/env bash
  dropbox_pid="$echo $(pgrep Dropbox)"
  kill -CONT $dropbox_pid
  </code></pre>
  
  <p>How do I do this by editing the local latexmkrc?</p>