Problem in Recycle bin Scheduler

Vote:
 
There is some problem with automatic recyclebin scheduler. Its not deleting the pages from recyclebin folder. I have set the time for 7 days and mark it as active. But its not generating any error, says 0 pages deleted, Even there are lots of junk pages in EPi recyclebin folder. Please write the solution at rajan@csmails.com thanks
#12724
Mar 25, 2008 18:35
Vote:
 
This scheduled job only removes items from the recycle bin that have been there for more than 30 days. So when your jobs runs every 7 days, it will check for items that have been there for 30 days and delete only those items.
#14788
Mar 25, 2008 18:45
Vote:
 
can i change 30 days to 7 days somewhere.I want to cleanup the recyclebin folder everyday.
#14789
Mar 25, 2008 18:45
Vote:
 
Hi Rajan. You can not change the number of days unfortunately, but you can write your own job that do the same as the [Automatic Emptying of Recycle Bin] in EPiServer. Use reflector and take a look at the job in EPiServer.Util.EmptyWastebasketJob: public static string Execute() { int num1 = 0; PageDataCollection collection1 = Global.EPDataFactory.GetChildren(Global.EPConfig.Wastebasket, AccessControlList.NoAccess); foreach (PageData data1 in ((IEnumerable) collection1)) { if (data1.IsDeleted && (data1.Saved <= DateTime.Now.AddDays(-30))) { try { Global.EPDataFactory.Delete(data1.PageLink, true, AccessControlList.NoAccess); num1++; continue; } catch (Exception exception1) { EmptyWastebasketJob.?.Error("17.3.1 Error when trying to delete page from recycle bin " + data1.PageLink.ToString(), exception1); continue; } } } return string.Format("{0} pages were deleted from recycle bin.", num1); } Regards. /Øyvind (Bob ;D) EPiServer Norway
#14790
Mar 25, 2008 18:45
Vote:
 
Hi! I wonder what Epi version your code is usable for? We have 4.31 and I try to compile my project but it does not like your EmptyWastebasketJob.Error Regards Mats Norgren
#14791
Mar 25, 2008 18:45