Support » Plugin: Online Backup for WordPress » Custom filesystem excludes not considered on local backup

  • Resolved Herbert


    today I just tested WP-Online-Backup on my local Laptop on a test installation with WP 3.4.2 and the latest 2.2.15 version. Want some simple safeguarding before starting the 3.5 upgrade work. As this test installation is locally on my PC only on XAMPP, no need to encrypt.

    I have ngg-gallery installed and a somewhat big picture gallery that I want to exclude, which is under c:\xampp\htdocs\wp-content\gallery
    In the general section I therefor added
    to the custom exclude list… together with a checked “uploades” exclude.

    Then run the manual backup in order to discover that I cannot “download” the file… (not sure why, other problem) but on the filesystem I can find a 31MB php file… So I start to suspect that the gallery exclude was not considered. I look into the PHP, just to discover that it’s basically a ZIP with some php-code in front… Stripped the extra bytes in front and open the ZIP … voila… wp-content/uploads was excluded, but wp-content/gallery is in… i.e. the exclude spec didn’t work.

    Any trick there?

    Thanks in advance, Herbert

    PS: support stuff:
    Online Backup for WordPress Plugin Version 2.2.15
    WordPress Version: 3.4.2
    PHP Version: 5.3.8
    MySQL Server Version: 5.5.16
    MySQL Client Version: 1.0
    Mem: 256M; Post: 8M; Upload: 128M; Timeout: 30
    End of Information

    From the activity log:
    Activity ID: 1
    Activity Type: Manual Backup
    Settings: Downloaded, Compressed

    Completion: Successful

    Backup Size: 30.41 MiB (2927 files)
    Total Size: 49.96 MiB (2927 files)

    Start Time: 23rd Dez 2012 1.23.09 PM
    End Time: 23rd Dez 2012 1.23.27 PM
    Time Type Event
    Time Type Event
    23rd Dez 2012 1.23.27 PM Information Backup complete.
    23rd Dez 2012 1.23.27 PM Information File system backup completed.
    23rd Dez 2012 1.23.20 PM Information Folder /htdocs/wp-content/uploads was excluded. (Uploads directory)
    23rd Dez 2012 1.23.20 PM Information Folder /htdocs/wp-content/plugins/wponlinebackup/tmp was excluded. (Online Backup for WordPress temporary backup directory)
    23rd Dez 2012 1.23.11 PM Information Database backup completed.
    23rd Dez 2012 1.23.11 PM Information Initialisation completed.
    23rd Dez 2012 1.23.10 PM Information Backup starting…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Online Backup


    Hi Herbert,

    Was the problem downloading due to timeouts or network errors? Be interesting to know. We have some changes coming soon to work around those, and if there are any other problems be good to see if we can fix or workaround those too.

    Not sure why the exclude did not take affect. Are you sure the path is wp-content/gallery? Try putting in just wp-content and see what happens, it might just be the word “gallery” isn’t matching the actual folder properly for some reason.


    quick response, thanks 🙂

    The download did not seem to even start. I’m using Firefox and it says “starting download” but does not seem to proceed, I waited 10 minutes, nothing. As mentioned, it’s completely local, i.e. no network speed problem and it’s only 35MB. But that’s a “side issue”, I will try later on my “production site”, as backup on the local laptop is not quite so important. Still it would be great to just create a plain ZIP file, that I can download and then delete with WinSCP, which I typicall use to up/download files from my production site, instead of the pseudo-php file.

    But the main topic: yes, I am absolutely sure that wp-content/gallery is the right path, and changing the exclude to just wp-content also did not do any good, it still backed up the almost complete wp-content directly.
    I tried various settings by now “./wp-content/gallery” “/htdocs/wp-content/gallery”… no success.

    If you look in the “events”, the events show two excludes the “wponlinebackup/tmp” and the “uploads” directory that I selected in the settings. My manually specified exclude is not mentioned at all, no warning, error, just not shows, as if it doesn’t exist.

    I’m a little hesitate to just “try” on my production site, on my laptop, I only have 35MB, but on production its almost 1GB, so an error will take long and fill up significant space.

    Thanks, Herbert

    Plugin Author Online Backup


    Hi Herbert,

    Thanks for the info. It might be due to some buffers or otherwise, but the new code we’re working on will bypass those so hopefully will work for you.

    For the exclude, can you check what you added into excludes is exactly the same as the actual folder name, as the excludes are case sensitive. That’s the only thing I can think of at the moment, that the folder is “Gallery” and you’ve added “gallery”.

    Failing that I will get a debug version ready you can run that will produce a log file, then we can see why the path isn’t matching.


    Hi there,

    Merry Christmas! Dinner is over, doing a little hacking while the x-th repeat of E.T. is on TV 🙂

    Located the problem why the exclude is not working. It’s a windows specific issue with forward-slash vs. backward-slash. I added debug output using the LogEvent function and compared the exclude list (prepared in the foreach after line 145) to the exclude list comparison path stored in “item_path” around line 850…
    The exclude list contains the full path:
    The created “item_path” variable contains:
    When the actual comparison is done using the function “array_search”, the “item_path” variable is passed into the search using the function “Normalise_Path”, however the exclude list itself is not consistently created with Normalise_Path in area after line 146, i.e. the array_search will not find the pattern.

    Fix: needs to be done on lines 160 and 164
    160: $excludes[$key++] = $this->Normalise_Path($parent_root . ‘/’ . $exclude_item);
    164: $excludes[$key++] = $this->Normalise_Path($root . ‘/’ . $exclude_item);

    And when that worked, I noticed there was no reason code behind the log event… the exclude_reasons array did not include a statement for the respective code, i.e. I added on line 65
    WPONLINEBACKUP_FILE_EXCLUDE_CUSTOM => __( ‘Custom directory exclude’, ‘wponlinebackup’ )
    which obviously also needs to be added to the translation files, but that does not matter much as a quick fix for me 🙂

    This solves the topic for me… the download issue is not hot, you work on that anyway, so I don’t mind for nwo. It may possibly work on my production site which runs under Linux, not Windows.



    Ah… and for some magical reason, the download worked now also when I tried… and I forgot to set the topic to resolved…

    Cheers, Herbert

    Plugin Author Online Backup


    Hi Herbert,

    Merry Christmas to you also!

    Saved ourselves a job thanks lol – but on Xmas day?! Hehe.

    I’ve fixed the custom exclude reason but already. Thanks for finding the cause of the exclude not working – ill add it to the next version next week!



Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom filesystem excludes not considered on local backup’ is closed to new replies.