first attempt to relocate attachmentstats cron code. Works !