Support » Plugin: Media Cleaner » cron job

  • Resolved pepekam


    Hello, how could this be set on cron. I would like to run it once a week automatically. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello?

    Plugin Author Jordy Meow


    Hi, the answer has been asked before a few times, but actually I have a reply to it in the FAQ, it’s here:

    I totally understand why there is some hesitation about a cronjob.

    But: I am scanning a media library / folder structure with some 40,000 (!) images / image refs and it takes hours to complete. I cannot use wordpress in any other way at the time while the scan is running because it will stop as soon as I move away from the scan-page. Also opening the some WP backend in a new window will force the scan to stop.

    So my wishes were
    a) allow at least scanning in the backround – either through a backend-background job or through a cron job
    b) for performance reasons, an option to “continue scan where it stopped last time” would be awesome. In combination with a cronjob you could then scan your media library “daily” during the night hours – let’s say 2:30 am till 4:00 am and work off the latest results throughout the day.

    And finally, (OT, maybe new thread): I don’t have an option to select how many results to show – is that a pro feature?

    Plugin Author Jordy Meow


    The solution is to do this on a computer that will be left running, on that same page 🙂

    Scanning in the background implies that everything is triggered by WP-Cron, and therefore, on users’ visits, or search engines’ spiders. It will slow down the visit for everyone, which might have an extremely negative impact. The process might also take potentially forever (if the website is not visited enough). Moreover, the browser currently holds a lot of data for the scan to avoid putting too much strain on the database and the server; doing this entirely server-side will cause performance and DB issues on too many installs. It also needs a lot of rewriting, so potential bugs and issues too.

    The “continue scan” is available, but of course… only if you didn’t close that window. So you can pause and resume later.

    Sorry, for now, it’s really not possible to do this, it would take way too much time and cause way too many issues once it’s done, and I really prefer to invest time in supporting more external plugins, and maybe simply optimizing the current process to make it better and faster. Even though if, of course, I totally understand your point.

    About the number of results to show; you can certainly do it 🙂 In the Settings page, you have an option “Results Per Page”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cron job’ is closed to new replies.