WP-CLI Backup determination

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #286271
    Jan
    Participant

    I am wondering how the plugin determines that it should do a Full Backup versus a DB backup. I have created a shell script where I want the Full to run on Sundays and if it’s not Sunday then do a DB backup.

    The settings for UpdraftPlus in WordPress is set to Manual for both types of backups. In my shell I am running wp updraftplus backup if it’s not Sunday, and wp updraftplus backup –include-files=”plugins,themes,uploads,wpcore,others” if it is Sunday.

    The script is correct, but wp updraftplus backup is running a full every time.

    What do I need to do differently?

    Thanks.
    Jan

    #286354
    Dee Nutbourne
    Moderator

    Hi Jan,

    When backing up via WP-CLI, the default value for --include-files as the ‘Include in files backup’ settings.

    You will need to either disable all sections of the file backup in the Settings tab, or pass the following to your database-only shell command:
    --include-files=""

    Best Wishes,
    David N

    #286515
    Jan
    Participant

    that doesn’t work. I used this: wp updraftplus backup –include-files=””
    and I get this error: Error: The given value for the ‘include-files’ option is not valid

    So how do I go about just doing a DB backup?

    Thanks.
    Jan

    #286519
    Jan
    Participant

    That didn’t work. I ran this: wp updraftplus backup –include-files=”” and also –include-files=” ”

    and I got this: Error: The given value for the ‘include-files’ option is not valid

    So how do I just do a DB backup?

    Thanks.
    Jan

    #286671
    Dee Nutbourne
    Moderator

    Hi Jan,

    You will need to go to the UpdraftPlus dashboard Settings tab, and disable all options in the ‘Include in files backup’ settings.
    Then, run a backup without the --include-files argument.

    Best Wishes,
    David N

    #286753
    Jan
    Participant

    Sorry to continue this conversation, but since I have to clear the options, is there a way to exclude files other than the backups, like backup*,*backups,backwpup*,wp-clone,snapshots and upgrade,cache,updraft,backup*,*backups,mysql.sql,debug.log?

    Sorry, but I didn’t see this in the documentation.

    Thanks.
    Jan

    #287299
    Dee Nutbourne
    Moderator

    Hi Jan,

    Apologies for the delay.

    Yes, the WP-CLI backup will still use the exclusion lists in the UpdraftPlus settings.

    For instructions on excluding specific files/directories, please see this guide:
    https://updraftplus.com/faqs/how-can-i-exclude-particular-filesdirectories-from-the-backup/

    Best Wishes,
    David N

    #287418
    Jan
    Participant

    No problem on the delay.

    The reason I asked is because when I clear the options, it also closes the excludes.

    So, when I look at the link you show, since #1 won’t work, and because I’m using wp-cli, my only option would be #2 right? But that would only be for a directory. What about files?

    Also, I noticed that #5 doesn’t appear right or I’m just not understanding what is happening. It says the filter to use is: updraftplus_skip_directory – but in the example it shows updraftplus_exclude_directory. So it’s a confusing on which one to use.

    As always, thanks for the help.
    Jan

    #287588
    Dee Nutbourne
    Moderator

    Hi Jan,

    Apologies for the confusion.

    I’ll make a note in our buglist to look into adding an exclusion parameter to the WP-CLI.

    In the meantime, if you enable the relevant sections of the backup, add the files to the exclusion list, and then disable the sections, the list should still be saved and used for backups.

    Best Wishes,
    David N

    #288061
    Jan
    Participant

    I re-enabled the sections(i.e. uploads), then the exclusions show , but when I disable again, so do the exclusions. I must be missing something or I misunderstood what you are saying.

    Please let us know when the exclusions has been added.

    Thanks.
    Jan

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘WP-CLI Backup determination’ is closed to new replies.