• Installed this a couple of days ago on the advice of my host, however it’s creating a lot of “empty” wp-cron.php files.. not in public_html, but the directory just prior /home/username/ directory

    Something amiss?
    A blank file: (wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8) is created every hour (I have it scheduled for once per hour)

    And my cron job is using the wget option.

    https://www.ads-software.com/extend/plugins/wp-cron-control/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter happyches

    (@happyches)

    Examples: (x 100)

    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.19
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.2
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.20
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.21
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.22
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.23
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.24
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.25
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.26
    /wp-cron.php?doing_wp_cron&6914780259be8b582781c1b68d129dc8.27

    I disabled wp-cron and enabled a cpanel server-side cron job on all of my clients’ sites – including mine – and I also have thousands of empty wp-cron.php.1, wp-cron.php.2, etc files on every /home/username folder that I performed this hack on. The sites load faster, but I am NOT a fan of all these empty files!

    Are you all still having this problem? If so, my guess is that you need to pass an additional option to wget (or perhaps get rd of one, depends). Can you post the wget commands you are putting in your .cron files?

    The default action of wget is to download the output of whatever it is told to retrieve and write it to a file in the working directory, which are here your users’ home directories (/home/$username). The default file name is the document name that you tell wget to retrieve, hence ‘wp-cron.php?doing_wp_cron&691…’. Wget will append a number to each output file’s name to avoid overwriting previous downloads.

    There are at least a couple of ways to avoid this behavior, one being to use the option -O - (that’s a capital o); this will instead write whatever wget retrieves to the standard output. Now, this may put a lot of extraneous stuff into your server’s cron logs, so it may not be desirable; I don’t know enough about how cron logging works. Your sysadmin should be able to tell you more.

    Another approach would be to investigate the -nc (–no-clobber) option.
    Try man wget and see what it says about this one. (In general, RTFM is good advice.)

    Hi happyches and caseyfriday,

    Try:
    wget -q -O - "https://www.domain.com/wp-cron.php?doing_wp_cron&2443c3564fe7d464a62b923211244116" > /dev/null 2>&1

    [Obviously replace the domain name and the secret key]

    Notes:
    (1) The “-O -” parameters instruct wget to write the output to stdout. This will help stop the many files from being created.
    (2) The “> /dev/null 2>&1” parameters are *nix command line parameters that basically capture all output and ignore it. Nothing gets captured or kept anywhere.

    I was getting heaps of files created on the file system (GoDaddy Hosting @ the time). After adding these two parameter options the file creation stopped with the outcome of the cron job still being run successfully.

    Kind regards,
    John.

    Hi all,

    For other people still having this issue (I had it too on one particular site), I found that using the php call (first option shown in the cron control panel) works on my server too and does not create those files while using wget – even with > /dev/null 2>&1 was still creating the files.

    Hope this helps someone.

    Smile,
    Juliette

    Is it okay to run this from a Cron website such as setcronjob.com ?

    They basically allow you to run crons through a url

    Also, should wp-cron be disabled in wp-config.php?

    @brodephat First of all: open your own topic, your question is not related to the topic discussed in this thread.

    Second of all: Bad idea. There is a reason why the secret key is called **secret**.

    And yes, if you do run wp-cron via a proper cronjob (i.e. NOT via an external website), you should disable wp-cron via a define in wp-config.php.

    Sorry, I am using the Wp-Cron Control plugin and I’m monitoring it to see If I too am getting empty files being created and was curious as to if I would see this issue using the method I mentioned.

    I will use my cpanel crons job instead.

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Lots of empty wp-cron.php files being created’ is closed to new replies.