angelo-v / wordpress-backup

Simple Docker container that helps you backup and restore your WordPress blog.
80 stars 60 forks source link

backup script is stopping before the end #25

Closed kasty closed 1 year ago

kasty commented 5 years ago

Hello, I have a problem using your wordpress backup. When running the backup script it's stopping before the end, the db archive is not created :

root@myhost# docker exec -it backup-container bash
root@f586c32ad7e9:/# bash backup

The log is ending on :

...
-rwxrwxr-x www-data/www-data      238 2019-05-21 13:26 ./wp-admin/ms-options.php
-rwxrwxr-x www-data/www-data     6320 2019-05-21 13:26 ./wp-admin/plugin-install.php
-rwxrwxr-x www-data/www-data      369 2019-05-21 13:26 ./wp-blog-header.php

When running throw the Makefile that is on my host the script runs well till the end : (extract of my Makefile)

backup:
    docker exec backup-container backup

Any idea ? Thanks for your work !

angelo-v commented 5 years ago

No error message? Sounds weird... What is the exit code of bash backup?

kasty commented 5 years ago

It appears that the error is aleatory, sometimes the scripts ends well, sometimes not. When it's not exit code is "1" :

bash backup
[....]
-rwxrwxr-x www-data/www-data      238 2019-05-21 13:26 ./wp-admin/ms-options.php
-rwxrwxr-x www-data/www-data     6320 2019-05-21 13:26 ./wp-admin/plugin-install.php
-rwxrwxr-x www-data/www-data      369 2019-05-21 13:26 ./wp-blog-header.php
root@f586c32ad7e9:/# echo $?
1

When successfull :

bash backup
[....]
-rwxrwxr-x www-data/www-data      238 2019-05-21 13:26 ./wp-admin/ms-options.php
-rwxrwxr-x www-data/www-data     6320 2019-05-21 13:26 ./wp-admin/plugin-install.php
-rwxrwxr-x www-data/www-data      369 2019-05-21 13:26 ./wp-blog-header.php
creating database dump
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Finished: SUCCESS
root@f586c32ad7e9:/# echo $?
0
angelo-v commented 5 years ago

aha, ok. From man tar:

this exit code means that some files were changed while being archived and so the resulting archive does not contain the exact copy of the file set.

I am not yet sure if and how I should handle that in wordpress-backup. I guess it might be a problem for sites that have really frequent updates. If this is not the case for you, try perfoming the backup during a "silent" period.

kasty commented 5 years ago

Mhh I see but that's strange, I don't see which files could be changed while archiving. Automated backups are already made during a "silent" period (at 3am).

I could find this warning but it doen't help me much : tar: ./wp-content: file changed as we read it

For the moment I added --ignore-failed-read option to the tar command, I'll try this during a few days and I'll see...

Thanks for your help

angelo-v commented 5 years ago

mhh, have you installed any plugins that change wp-content folder? Could you detect what exactly is changed there?