As this is such an important part of the tool and I've compared checksums of the original backup and then after imports and exports to ensure that nothing has changed between them beyond something expected or that can be justified.
The originating export was taken from a system with Emonbase and EmonTX. My test setup is a VM running Ubuntu 22.10.
The procedure followed was to:
Build a vanilla VM with the latest code
Import my original export - /mnt/vfs_share/emoncms-backup-2023-02-23.tar.gz below
Run an export, this failed due to insufficient space - handy for proving the error checking
=== Emoncms export start ===
Sun 26 Mar 22:01:23 BST 2023
Backup module version:
"version" : "2.3.2",
EUID: 1000
Reading /opt/emoncms/modules/backup/config.cfg....
Location of databases: /var/opt/emoncms
Location of emonhub.conf: /etc/emonhub
Location of Emoncms: /var/www/emoncms
Backup destination: /var/opt/emoncms/backup
emoncms backup module location /var/www/emoncms/Modules/backup
-- adding /var/opt/emoncms/backup/emoncms.sql to archive --
tar: Removing leading `/' from member names
/var/opt/emoncms/backup/emoncms.sql
tar: Removing leading `/' from hard link targets
no /etc/emonhub/emonhub.conf to backup
-- adding /var/www/emoncms/settings.ini to archive --
tar: Removing leading `/' from member names
/var/www/emoncms/settings.ini
tar: Removing leading `/' from hard link targets
no /var/www/emoncms/settings.php to backup
-- adding /var/opt/emoncms/phpfina to archive --
phpfina/
phpfina/14.dat
phpfina/11.dat
phpfina/10.dat
phpfina/21.dat
phpfina/62.meta
phpfina/14.meta
phpfina/18.dat
phpfina/8.meta
phpfina/18.meta
phpfina/48.dat
tar: /var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar: Wrote only 8192 of 10240 bytes
tar: Error is not recoverable: exiting now
Error: RC=2 occurred on line 143
Error: failed to tar phpfina
-- adding /var/opt/emoncms/phpfiwa to archive --
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Error: RC=2 occurred on line 143
Error: failed to tar phpfiwa
-- adding /var/opt/emoncms/phptimeseries to archive --
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Error: RC=2 occurred on line 143
Error: failed to tar phptimeseries
Compressing archive...
/var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar:
gzip: /var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar.gz: No space left on device
Error: RC=1 occurred on line 156
Error: failed to compress tar file
emoncms export failed
=== Emoncms export completed with ERRORS! ===
And output from successful run in step 4:
=== Emoncms export start ===
Sun 26 Mar 22:02:28 BST 2023
Backup module version:
"version" : "2.3.2",
EUID: 1000
Reading /opt/emoncms/modules/backup/config.cfg....
Location of databases: /var/opt/emoncms
Location of emonhub.conf: /etc/emonhub
Location of Emoncms: /var/www/emoncms
Backup destination: /var/opt/emoncms/backup
emoncms backup module location /var/www/emoncms/Modules/backup
-- adding /var/opt/emoncms/backup/emoncms.sql to archive --
tar: Removing leading `/' from member names
/var/opt/emoncms/backup/emoncms.sql
tar: Removing leading `/' from hard link targets
no /etc/emonhub/emonhub.conf to backup
-- adding /var/www/emoncms/settings.ini to archive --
tar: Removing leading `/' from member names
/var/www/emoncms/settings.ini
tar: Removing leading `/' from hard link targets
no /var/www/emoncms/settings.php to backup
-- adding /var/opt/emoncms/phpfina to archive --
phpfina/
phpfina/14.dat
phpfina/11.dat
phpfina/10.dat
phpfina/21.dat
phpfina/62.meta
phpfina/14.meta
phpfina/18.dat
phpfina/8.meta
phpfina/18.meta
phpfina/48.dat
phpfina/19.dat
phpfina/17.meta
phpfina/17.dat
phpfina/9.dat
phpfina/22.meta
phpfina/13.meta
phpfina/7.meta
phpfina/22.dat
phpfina/7.dat
phpfina/9.meta
phpfina/30.meta
phpfina/13.dat
phpfina/10.meta
phpfina/21.meta
phpfina/12.dat
phpfina/19.meta
phpfina/8.dat
phpfina/20.meta
phpfina/11.meta
phpfina/62.dat
phpfina/30.dat
phpfina/20.dat
phpfina/50.meta
phpfina/48.meta
phpfina/50.dat
phpfina/12.meta
-- adding /var/opt/emoncms/phpfiwa to archive --
phpfiwa/
-- adding /var/opt/emoncms/phptimeseries to archive --
phptimeseries/
phptimeseries/feed_26.MYD
phptimeseries/feed_27.MYD
phptimeseries/feed_61.MYD
phptimeseries/feed_25.MYD
phptimeseries/feed_24.MYD
phptimeseries/feed_28.MYD
phptimeseries/feed_31.MYD
phptimeseries/feed_29.MYD
Compressing archive...
/var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar: 78.3% -- replaced with /var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar.gz
Backup saved: /var/opt/emoncms/backup/emoncms-backup-emoncms-vm-2023-03-26.tar.gz
Sun 26 Mar 22:03:39 BST 2023
Backup included components: /var/opt/emoncms/backup/emoncms.sql /var/www/emoncms/settings.ini phpfina phpfiwa phptimeseries
INFO: These components couldn't be found to backup: /etc/emonhub/emonhub.conf /var/www/emoncms/settings.php
Export finished...refresh page to view download link
=== Emoncms export complete! ===
This PR was triggered to support issue https://github.com/emoncms/backup/issues/63, provide error checking and alerting and refine the log update window to support this. It also build on top of PR https://github.com/emoncms/backup/pull/70
As this is such an important part of the tool and I've compared checksums of the original backup and then after imports and exports to ensure that nothing has changed between them beyond something expected or that can be justified.
The originating export was taken from a system with Emonbase and EmonTX. My test setup is a VM running Ubuntu 22.10.
The procedure followed was to:
/mnt/vfs_share/emoncms-backup-2023-02-23.tar.gz
below~/Downloads/emoncms-backup-emoncms-vm-2023-03-26.tar.gz
below~/Downloads/emoncms-backup-emoncms-vm-2023-03-26-1.tar.gz
belowI started by untarring the original export and collating a list of the file extracted:
Then untar export 1 and collate a list of files:
Run a diff between the 2 to compare if files are missing
emonhub.conf not found, this is expected as my test VM doesn't have emonhub installed
Create a list of MD5 checksums for all files in the original and export 1 directories, then compare the checksums:
Emonhub expected as it's not installed on my VM and thereby not backed up.
Run a diff on the 2 emoncms.sql:
The changes are due to updated software and add COLLATE or DEFAULT CHARSET to lines and different dump completion times, hence nothing untoward.
Now untar export 2 and compare file contents with export 1:
No changes here.
Create checksums for export 2 and compare with export 1:
Only emoncms.sql different as follows:
The only delta being the time it ran.
Output from failed export in step 3:
And output from successful run in step 4: