The new image export script is … /opt/emoncms/modules/backup/emoncms-export.sh which behaves differently to the previous export script - now any previous export.tar.gz files are removed before the new one is created.
And this maybe a necessity given export.tar.gz’s are saved in /opt/openenergymonitor/data which is in /dev/root sized 4GB and has limited space available – 50% in my test installation with no exports saved there.
Newbie comments …
• If the export process fails then any prior export will have diappeared
• Users may wish to use prior cron scheduled exports as part of their backup scheme.
Is there a way to save several exports without filling /dev/root ?
PS: I’ve changed my location of the export.tar.gz file to /var/opt/emoncms by making the following change in /opt/emoncms/modules/backup/config.cfg …
# Destination location of exported backup .tar.gz - Must be writable ## Mod by JB ## backup_location="/opt/openenergymonitor/data" backup_location="/var/opt/emoncms"
The new image allocates 4GB to /dev/root whereas /var/opt/emoncms (/dev/mmcblk0p3) is allocated 10GB. And it also seems very logical for exported data to be saved alongside the current live time series data.
Furthermore not content with 10GB for data, I’ve burned the new image to a 32GB SDHC and then expanded /dev/mmcblk0p3 to 25GB as follows …
Do sudo parted Then do print This will show #3 as the Ext2 data partition which is to be expanded. Then do resizepart and respond with 3 Respond Yes to the question about the partition already being mounted At the prompt End? (15.5GB)? … enter the new ending point in MB … I used 31600 Verify the change has been made by doing print Finish by doing quit Finally expand the Ext2 file system to use its newly enlarged partition … Do sudo resize2fs /dev/mmcblk0p3 Finally verify all is OK by doing df -hT
Of course as it stands, this larger partition will only contain the single latest export.tar.gz. So another step is to figure out how to retain more than one of these files.
And I’m hoping my changes will not be affected by future version upgrades.