CRON Jobs

Permalink
Hi C5,

I was running the CRON jobs and inadvertently deleted one and I don't know how to get it back.

The job is : remove 10 oldest page versions

I am still building the site so by now there are tons of old page versions that need to get deleted...

Thanks!
M

MarcYBB
 
mesuva replied on at Permalink Best Answer Reply
mesuva
I'm fairly certain this can only be resurrected by manually inserting the job record back into the database.

This query should do it:
INSERT INTO `Jobs` (`jID`, `jName`, `jDescription`, `jDateInstalled`, `jDateLastRun`, `pkgID`, `jLastStatusText`, `jLastStatusCode`, `jStatus`, `jHandle`, `jNotUninstallable`, `isScheduled`, `scheduledInterval`, `scheduledValue`)
VALUES
   (6, 'Remove Old Page Versions', 'Removes all except the 10 most recent page versions for each page.', '2016-11-22 19:51:56', NULL, 0, NULL, 0, 'ENABLED', 'remove_old_page_versions', 0, 0, 'days', 0);

(this is for 5.7, pretty sure it would be the same for v8 as well)
MarcYBB replied on at Permalink Reply
MarcYBB
That did it!
It was a little daunting as I have never messed around in the database - but it worked 1st time around.
Thanks for taking the time to help me out.
Marc
JohntheFish replied on at Permalink Reply
JohntheFish
There is a 5.6 addon that restores core jobs
http://www.concrete5.org/marketplace/addons/restore-automated-jobs/...

It's fairly simple, so should be easy enough to quickly hack to run on 5.7 (though a lot more work to get it marketplace ready).