Perform task on opening the site
You might check out the 'Examples for Developers' project page for some relevant examples:
https://www.drupal.org/project/examples

I think you want to use hook_init instead of hook_menu. Try this:

function mymod_init() {
  if (drupal_is_front_page()){
    $items = array();

    $items['/'] = array('page callback' =&gt; 'mymod_do_it');

    return $items;
  }
}