Skip to content

Instantly share code, notes, and snippets.

@andreik6v
Forked from hofmannsven/README.md
Created March 20, 2023 18:07
Show Gist options
  • Select an option

  • Save andreik6v/dfd557f6deb8ed50fff328bc6e0fe7cd to your computer and use it in GitHub Desktop.

Select an option

Save andreik6v/dfd557f6deb8ed50fff328bc6e0fe7cd to your computer and use it in GitHub Desktop.

Revisions

  1. @hofmannsven hofmannsven revised this gist Jun 14, 2022. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,2 @@
    WordPress Backups with WP-CLI
    ===============

    Related tutorial: https://code64.de/visionerdy/wordpress-backups/
    ===============
  2. @hofmannsven hofmannsven revised this gist Oct 22, 2015. No changes.
  3. @hofmannsven hofmannsven revised this gist Oct 22, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    WordPress Backups
    WordPress Backups with WP-CLI
    ===============

    Blogpost: https://code64.de/visionerdy/wordpress-backups/
    Related tutorial: https://code64.de/visionerdy/wordpress-backups/
  4. @hofmannsven hofmannsven revised this gist Oct 22, 2015. No changes.
  5. @hofmannsven hofmannsven revised this gist Oct 22, 2015. 3 changed files with 7 additions and 0 deletions.
    1 change: 1 addition & 0 deletions crontab
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    30 18 * * * sh /var/www/backups/backup.sh > /var/www/logs/cronlog 2>&1
    3 changes: 3 additions & 0 deletions db_backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/sh

    wp db export - | gzip > ./db_backup-$(date +%Y-%m-%d-%H%M%S).sql.gz
    3 changes: 3 additions & 0 deletions wp_backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/sh

    tar --create --gzip --verbose --absolute-names --file=./wp_backup-$(date +%Y-%m-%d-%H%M%S).tar.gz --exclude=*.tar.gz /var/www/websites/wp
  6. @hofmannsven hofmannsven revised this gist Oct 22, 2015. 2 changed files with 5 additions and 3 deletions.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,4 @@
    TODO
    WordPress Backups
    ===============

    Blogpost: https://code64.de/visionerdy/wordpress-backups/
    4 changes: 2 additions & 2 deletions backup.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/sh

    /usr/local/bin/wp db --path=/vagrant/www/wpse --allow-root export - | gzip > /vagrant/www/backups/db_backup-$(date +%Y-%m-%d-%H%M%S).sql.gz &
    tar --create --gzip --absolute-names --file=/vagrant/www/backups/wp_backup-$(date +%Y-%m-%d-%H%M%S).tar.gz --exclude=*.tar.gz /vagrant/www/wpse
    /usr/local/bin/wp db --path=/var/www/websites/wp - | gzip > /var/www/backups/db_backup-$(date +%Y-%m-%d-%H%M%S).sql.gz &
    tar --create --gzip --absolute-names --file=/var/www/backups/wp_backup-$(date +%Y-%m-%d-%H%M%S).tar.gz --exclude=*.tar.gz /var/www/websites/wp
  7. @hofmannsven hofmannsven created this gist Oct 22, 2015.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    TODO
    ===============
    4 changes: 4 additions & 0 deletions backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    #!/bin/sh

    /usr/local/bin/wp db --path=/vagrant/www/wpse --allow-root export - | gzip > /vagrant/www/backups/db_backup-$(date +%Y-%m-%d-%H%M%S).sql.gz &
    tar --create --gzip --absolute-names --file=/vagrant/www/backups/wp_backup-$(date +%Y-%m-%d-%H%M%S).tar.gz --exclude=*.tar.gz /vagrant/www/wpse