Problem whit uploads dir

This topic contains 13 replies, has 2 voices, and was last updated by  udadmin 3 years, 5 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #17953
    canalesglobalcultura
    User

    Hi

    I am having several problem with the uploads dir in my multisite instalation. I’m using a dropbox account where “themes.zip”, “plugins.zip”, “others.zip” and “db.gz” are uploading without problems but not the same with “uploads.zip”.

    “Uploads.zip” is not being uploaded so the file on the “updraft” dir is not being deleted and therefore my disk quota is decreasing. Furthermore the backup process try to repeat the attempt so it duplicates the problem. I had to manually delete Active jobs

    I will send you a mail with some screen captures and also the log file. Please let me know the solution as soon as possible

    #18250
    udadmin
    Keymaster

    Hi,

    The log indicates that the backup did not finish on its first run, and would be resumed later.

    1) Has it made any progress in the mean-time?
    2) If not, then is it a site that has any visitors during the night? (If not, then UD never gets to run – because it relies on WordPress handing over to it).

    David

    #18257
    canalesglobalcultura
    User

    Hi,

    1) No, it hasn’t
    2) Probably yes but is my problem related to the wp scheduler? It is disabled because wp-cron is executed as a cron job (but it seems not working)

    Also, I didn’t know that a running backup from the shell can be done. I just read it now at FAQs 😉

    I try it and let you know

    Thanks,

    #18258
    udadmin
    Keymaster

    Hi,

    The scheduler is disabled? That’ll likely be it – probably your cron job does not run frequently enough. Try running it every 10 minutes in the period that the backup is active…

    … however, running from the shell is *much* better, if your host allows that.

    David

    #18261
    canalesglobalcultura
    User

    Hi David

    I don’t have shell access, so I’m trying to run it as cron job; but I can’t. I have saved a php file at wp root directory that contains just this:

    <?php

    define(‘UPDRAFTPLUS_CONSOLELOG’, true);
    require_once(‘wp-load.php’);
    do_action(‘updraft_backup_all’);

    ?>

    But the cron job is being called from another directory (where the crontab is; I can not change that), therefore the “wp-load.php” file is not found. The error is:

    Fatal error: require_once(): Failed opening required ‘./wp-load.php’ (include_path=’.:/usr/local/lib/php’) in /home/……/public_html/Updraft_Backup.php on line 4

    What can I do?

    #18263
    udadmin
    Keymaster

    Hi,

    In your cron job, begin with a “cd” command to move to the directory with wp-load.php and the above file in it (i.e. cd “/home/…/public_html”

    Best wishes,
    David

    #18269
    canalesglobalcultura
    User

    Hi, David

    After I spent a lot of time trying to make it work, I found that in a WordPress MU installation is not as simple as add a “cd” command to move to the directory because is not posible to load ‘wp-load.php’ and also not ‘wp-config.php’ from command-line. The only way I can run it is saving a cron job as “curl http://….thephpfile.php” but I’m not sure it will produce same problem uploading big files to dropbox

    How do you have tested the plugin in a WP Multisite running from command-line? Do you try to run it as “/usr/bin/php …./thephpfile.php”?

    Thanks,

    #18274
    udadmin
    Keymaster

    Hi,

    Do you find that the call to wp-load.php doesn’t return? I just tried it on one of my multisite installs, and it appears not to return, unlike on non-multisite. I had not been aware of that. I am looking for solutions and will get back to you.

    David

    #18277
    canalesglobalcultura
    User

    Hi, David

    I added this lines to my php file:

    if ( !defined(‘ABSPATH’) ) {
    chdir(‘/home/…/public_html/’);
    $ruta = ‘/home/…/public_html/’;
    set_include_path(get_include_path() . PATH_SEPARATOR . $ruta);
    define( ‘ABSPATH’, getcwd() . ‘/’ );
    if ( file_exists( ABSPATH . ‘wp-load.php’) and (is_readable( ABSPATH . ‘wp-load.php’) ) ) {
    $dirlog=”wp-load.php exists and is readable at “.ABSPATH;
    error_log($dirlog, 1, “mymail”);
    require_once( ABSPATH . ‘wp-load.php’ );
    error_log(“file loaded”, 1, “mymail”);
    } else {
    $dirlog=”wp-load.php DONT exists or is NOT readable at “.ABSPATH;
    error_log($dirlog, 1, “mymail”);
    }

    I received one mail with the text: wp-load.php exists and is readable at ‘/home/…/public_html/’; no more mails received.

    I made a change, loading directly wp-config.php. Same result; just one mail

    I made another change, loading a simply php test file (just an echo). The result? I receive one mail with the text: wp-load.php exists and is readable at ‘/home/…/public_html/’; and immediately another mail with the text “file loaded”

    So, I googled.. and I find some things like this: http://core.trac.wordpress.org/ticket/14913

    My site is a hosting domain, so I can’t do so many tests, so please when you have resolved the problem, lets me know as soon as possible

    Thanks,

    #18278
    udadmin
    Keymaster

    Hi,

    Yes – that WordPress core bug (14193) is the relevant one that is stopping the cron job from working on WP Multisite. Good find!

    Note that there’s a patch available in that bug report – if you patch your WordPress core, then it may then work… I’d be interested to hear if it does.

    Looking at what the patch does, another option would be for you to set $_SERVER[‘HTTP_HOST’] in your PHP file to match the main site on your multisite.

    David

    #18286
    canalesglobalcultura
    User

    Hi, David

    Set $_SERVER[‘HTTP_HOST’] in my PHP file don’t work and the “curl http://….thephpfile.php” is producing same problems with the upload of big files to dropbox.

    Please send me the ms-settings.php with the patch applied as soon as posible. I need to do my backup completely and send it to dropbox urgently

    Thanks

    #18287
    udadmin
    Keymaster

    Hi,

    Here’s a patched version of ms-settings.php – you’ll need to remove the .txt extension after downloading, of course: http://david.dw-perspective.org.uk/tmp/ms-settings.php.txt

    For future usefulness, to apply the patch to ms-settings.php in my install, I just did this:

    # cd /path/to/wordpress/install/directory
    # wget http://core.trac.wordpress.org/raw-attachment/ticket/14913/14913.diff
    # patch -p1 </tmp/14913.diff

    I tested, and it worked for me – after applying the patch, I could backup from the shell.

    David

    #18288
    canalesglobalcultura
    User

    Hi, David

    It works!

    I will keep an eye on it during the next days but, at the moment, my first test have been worked fine from the shell.

    Thanks for all your support

    #18289
    udadmin
    Keymaster

    🙂

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.