public ActionResult RunDailyTasks()
        {
            Logging.dlog("RunDailyTasks");

            Web.CacheClearAll();

            // if there is anything to do every day, do it here
#if AutocompletePhrase
            // re-do autocomplete phrases for expired content (assumes content tends to expire daily)
            AutocompletePhrase.AutocompletePhraseCleanup();
#endif

#if ModificationLog
            //daily remove old mod logs
            if (BewebData.GetValueInt(new Sql("select count(*) from sys.objects where name like ", "ModificationLogTemp".SqlizeLike()), 0) > 0)
            {
                // remove the temp table if it exists
                new Sql("drop table ModificationLogTemp").Execute();
            }
            var s = @"
select * into ModificationLogTemp from ModificationLog where UpdateDate > getdate()-90;
truncate table ModificationLog;
set identity_insert ModificationLog ON;
insert into ModificationLog ([ModificationLogID],[UpdateDate],[PersonID],[TableName],[RecordID],[ActionType],[UserName],[ChangeDescription],[RecordIDChar]) select [ModificationLogID],[UpdateDate],[PersonID],[TableName],[RecordID],[ActionType],[UserName],[ChangeDescription],[RecordIDChar] from ModificationLogTemp;
set identity_insert ModificationLog OFF;
drop table ModificationLogTemp";
            new Sql(s).Execute();
#endif
            Logging.dlog("RunDailyTasks start");
            //TASKS here
            //update the run time in the database
            Settings.All.ScheduledTaskLastDailyRunTime = DateTime.Now;
            Settings.All.Save();

            //SendEMail.SendDeadLetter("RunDailyTasks",30);
            Logging.dlog("RunDailyTasks done");
            return(Content("OK"));
        }