title: Ask MongoDB if it is Master out of a bashscript
body: <p>My mongodb is supposed to run a backup every day. It runs with one master and two slaves.</p>
  
  <p>I need to make a backup of ONE of them (cause they're just replicas)</p>
  
  <p>The easiest way would be to run the backup script on only one instance. but what if this instance is down? So I thought it would be good to run the backupscript on the master, cause there's always one master, even if one of the other ones is down.</p>
  
  <p>So I need to tweak my backupscript in cron.daily to ask mongodb if it is the current master.</p>
  
  <p>How do I do that?</p>