Backup Module issues

Just installed the backup module into an up to date EmonCMS installation. in preparation for an upgrade to Stretch.

First issue is that the file locations are hardcoded as /home/pi/backup. For me, this location is already in use so is not feasible. For others, the user may not be ‘pi’. This really needs to be configurable. I changed the locations I could find, but the export module will not run from the web interface. There is no message to say it is not running and has failed. There was a directory link from the backup/backup that was coloured red. I tried to recreate this but my new link was not in red so this may be the issue.

I looked at the service-runner part of the backup readme, but I am unsure what the crontab is or how to add something to it. I tried to simply run the service runner script from the command line but that seemed to run the backup immediately.

I then attempted to run the export shell script from the installed directory. I get errors but a backup file has been generated. Was it successful or not? How would I know?

Finally, where is the emoncms.config file to be found?

[email protected]:~/oem/data $ ./../backup/
=== Emoncms export start ===
Sat 17 Feb 22:56:34 GMT 2018
EUID: 1000
Reading /home/pi/oem/backup/config.cfg....
Location of mysql database: /var/lib/mysql/emoncms
Location of emonhub.conf:
Location of emoncms.conf:
Location of Emoncms: /var/www/emoncms
Backup destination: /home/pi/oem/data
old image
Failed to stop feedwriter.service: Unit feedwriter.service not loaded.
Emoncms MYSQL database dump complete, adding files to archive ..
tar: Removing leading '/' from member names
tar: /emonhub.conf: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Error: failed to tar config data
emoncms export failed
[email protected]:~/oem/data $ ls -la
total 64
drwxr-xr-x 3 pi pi  4096 Feb 17 22:56 .
drwxr-xr-x 5 pi pi  4096 Feb 17 22:28 ..
-rw-r--r-- 1 pi pi 30720 Feb 17 22:56 emoncms-backup-2018-02-17.tar
-rw-r--r-- 1 pi pi 18202 Feb 17 22:56 emoncms.sql
drwxr-xr-x 2 pi pi  4096 Feb  8  2017 import

@glyn.hudson - Any thoughts on this - looks like it was something you developed initially :slight_smile:

When coloured red the symlink target doesn’t exist, ideally they are green in colour.

1 Like

Can anyone explain the service-runner section of the readme please?

Is this still needed? What does it do and how exactly to install it?