Hi Matt,
Thanks again for this great plugin.
Can you please let me know what you mean by different instances of Revisr on different WP installations causing a corrupt repo? Are you tracking the same files across multiple repos?
I have three different WP installations in three different directories, each having its own DB, to cover the three languages in which I write.
Each installation of WP has its own Revisr; this is what I mean by different instances of Revisr.
Each of these instances covers the entire site (that is, its repo is the root directory of the site, so that they use the same repo), and records the files that must be ignored, in the .gitignore file in the root directory of the site. Git commands that are issued by Revisr, also take into account the identical .gitignore files that I placed in each of the WP installation directories.
With that explained, each of the instances of Revisr will track the same files, without any possibility to deviate from this; the difference between them is only in the databases they back up, each one backing up the DB of its WP instance.
If I set automatic daily backups on all three instances, I have no way to indicate the times to fire these automatic backups, and they will be done at the times you have hard-coded (unless you hard-coded random times).
This means that the daily backups on all three Revisr instances will be fired simultaneously by three php processes.
These three concurrent processes will try simultaneously to back up the DBs, stage files and commit.
I do not think git has been designed for concurrent staging and committing in the same repo; different users/processes are supposed to use different repositories, and push/pull to sync them.
I have not been able to understand whether git will be able to manage this; the closest reference I have found, is this one that says that they have seen corrupt repos from concurrent fetches and pulls:
https://forums.perforce.com/index.php?/topic/3921-lock-file-preventing-concurrent-transactions/
Note that scheduling the auto backups at different times is not a good solution since various delays may cause the backups to to be fired by the same wp-cron run.
I think it would be cleaner and more efficient if one Revisr instance were able to back up all databases. In this case other instances may be removed, and all problems with multiple installations will be resolved, as far as I can understand.
If you do allow backing up more than one database, it would be a good idea not to limit it by WP databases. For example, for some time I have run Piwik analytics on my site, and it had its own database. It would be great if Revisr were able to back up all such databases run by other web applications.
Hope this helps.
I am glad you are working on this.