Hey Robert, a couple things that might clear up what's happening for you.
When a ticket becomes stale, it's marked Overdue. A ticket will only become stale if it's not marked overdue, therefore, it only happens once, that's why it's not happening every hour.
The reason you're getting 3 emails is due to an easily fixable bug. The markOverdue function sends emails to 3 people, the Admin, Department Manager, and Ticket Assignee. I'm going to assume all 3 of these are you. Luckily all but 1 line of logic exists to fix this.
Around ln: 510 in class.ticket.php (if you haven't modified stuff) you'll find:
$sentlist=array();
foreach( $recipients as $k=>$staff){
if(!$staff || !is_object($staff) || !$staff->isAvailable()) continue;
if(in_array($staff->getEmail(),$sentlist)) continue; //avoid duplicate emails.
$alert = str_replace("%staff",$staff->getFirstName(),$body);
$email->send($staff->getEmail(),$subj,$alert);
}
Just add
$sentlist=$staff->getEmail();
before the closing bracket.
$email->send($staff->getEmail(),$subj,$alert);
$sentlist=$staff->getEmail();
}
And that'll take care of the triple send.
As far as sending every hour, there are a couple problems with that. 1 is that as mentioned above a flag is set 'isoverdue' in the database, and the function that checks if something is overdue, and ends up calling markoverdue checks that, (as does markoverdue). So you might think you can just pull it out, but something you should also know is that cron is actually fired off every time a staff members views a page in the staff end of osTicket. (There's a 1px image in the footer that runs autocron.php, which includes class.cron.php etc)
So when you setup your crontab to go every hour, you're really telling it you want cron to run -at least- every hour.
Is it possible to do what you want? Sure. Does it require a bit of effort, and probably adding another field to your table, yeah. If you -really- want it to alert you every hour, let me know and I can point you in the right direction, but just consider for every open ticket over a weekend you're going to get at least 48 emails.