Backup ran out of space

while trying to use the inbuilt backup i got an error about space.

=== Emoncms export start ===
Mon 10 Feb 18:34:21 GMT 2020
Backup module version:
    "version"      : "2.2.0"
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: /opt/openenergymonitor/data
emoncms backup module location /var/www/emoncms/Modules/backup
Image version: emonSD-17Oct19
-- adding /opt/openenergymonitor/data/emoncms.sql to archive --
tar: Removing leading `/' from member names
-- adding /etc/emonhub/emonhub.conf to archive --
tar: Removing leading `/' from member names
/etc/emonhub/emonhub.conf
tar: Removing leading `/' from hard link targets
-- 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 file /var/www/emoncms/settings.php
-- adding /var/opt/emoncms/phpfina to archive --
phpfina/
phpfina/138.meta
phpfina/141.meta
phpfina/185.dat
phpfina/32.meta
phpfina/53.meta
phpfina/31.meta
phpfina/130.dat
phpfina/115.meta
phpfina/25.dat
phpfina/58.dat
phpfina/70.meta
phpfina/175.meta
phpfina/38.dat
phpfina/122.dat
phpfina/173.dat
phpfina/27.meta
phpfina/159.meta
phpfina/136.dat
phpfina/154.dat
phpfina/29.dat
phpfina/16.meta
phpfina/177.dat
phpfina/62.meta
phpfina/173.meta
phpfina/169.dat
phpfina/148.dat
phpfina/117.meta
phpfina/189.dat
phpfina/57.dat
phpfina/191.meta
phpfina/58.meta
phpfina/124.dat
phpfina/167.dat
phpfina/128.meta
phpfina/64.dat
phpfina/115.dat
phpfina/120.meta
phpfina/178.meta
phpfina/117.dat
phpfina/34.dat
phpfina/112.dat
phpfina/39.meta
phpfina/129.dat
phpfina/190.dat
phpfina/149.dat
phpfina/184.meta
phpfina/74.meta
phpfina/125.dat
phpfina/155.meta
phpfina/122.meta
phpfina/24.dat
phpfina/178.dat
phpfina/48.dat
phpfina/66.dat
phpfina/136.meta
phpfina/174.dat
phpfina/56.dat
phpfina/138.dat
phpfina/39.dat
phpfina/132.dat
phpfina/70.dat
phpfina/124.meta
phpfina/109.dat
phpfina/191.dat
phpfina/129.meta
phpfina/189.meta
phpfina/65.meta
phpfina/127.meta
phpfina/53.dat
phpfina/141.dat
phpfina/146.meta
phpfina/118.meta
phpfina/193.meta
phpfina/61.meta
phpfina/10.dat
phpfina/158.dat
phpfina/75.meta
phpfina/154.meta
phpfina/176.dat
phpfina/11.meta
phpfina/114.meta
phpfina/68.meta
phpfina/135.dat
phpfina/3.meta
phpfina/47.meta
phpfina/119.meta
phpfina/113.dat
phpfina/66.meta
phpfina/126.dat
phpfina/76.dat
phpfina/17.meta
phpfina/3.dat
phpfina/75.dat
phpfina/175.dat
phpfina/132.meta
phpfina/56.meta
phpfina/171.dat
phpfina/133.meta
phpfina/139.dat
phpfina/174.meta
phpfina/184.dat
phpfina/185.meta
phpfina/140.meta
phpfina/62.dat
phpfina/49.dat
phpfina/163.meta
phpfina/186.dat
phpfina/192.dat
phpfina/153.dat
phpfina/38.meta
phpfina/74.dat
phpfina/68.dat
phpfina/120.dat
phpfina/108.dat
phpfina/164.meta
phpfina/72.meta
phpfina/36.dat
phpfina/162.meta
phpfina/65.dat
phpfina/188.dat
phpfina/77.dat
phpfina/32.dat
phpfina/36.meta
phpfina/77.meta
phpfina/111.meta
phpfina/35.meta
phpfina/71.dat
phpfina/162.dat
phpfina/187.meta
phpfina/71.meta
phpfina/17.dat
phpfina/169.meta
phpfina/49.meta
phpfina/11.dat
phpfina/109.meta
phpfina/47.dat
phpfina/108.meta
phpfina/140.dat
phpfina/60.meta
phpfina/55.meta
phpfina/128.dat
phpfina/116.meta
phpfina/125.meta
phpfina/181.meta
phpfina/76.meta
phpfina/31.dat
phpfina/131.dat
phpfina/158.meta
phpfina/181.dat
phpfina/48.meta
phpfina/73.dat
phpfina/1.dat
phpfina/186.meta
phpfina/46.meta
phpfina/72.dat
phpfina/61.dat
tar: /opt/openenergymonitor/data/emoncms-backup-2020-02-10.tar: Wrote only 6144 of 10240 bytes
tar: Error is not recoverable: exiting now
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: failed to tar phpfiwa
-- adding /var/opt/emoncms/phptimeseries to archive --
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Error: failed to tar phptimeseries
Compressing archive...
/opt/openenergymonitor/data/emoncms-backup-2020-02-10.tar:	
gzip: /opt/openenergymonitor/data/emoncms-backup-2020-02-10.tar.gz: No space left on device
Error: failed to compress tar file
emoncms export failed

SERVER INFO

Server Information

Server Information

Services

  • emonhub :- Active Running
  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 300s 9453 feed points pending write
  • service-runner :- Active Running
  • emonPiLCD :- Active Running
  • redis-server :- Active Running
  • mosquitto :- Active Running
  • demandshaper :- Active Running

Emoncms

Server

  • OS :- Linux 4.19.75-v7+
  • Host :- emonpi | emonpi | (192.168.1.215)
  • Date :- 2020-02-10 18:48:59 UTC
  • Uptime :- 18:48:59 up 23 days, 28 min, 0 users, load average: 0.12, 0.65, 0.93

Memory

  • RAM :- Used: 19.93%
    • Total :- 975.62 MB
    • Used :- 194.43 MB
    • Free :- 781.19 MB
  • Swap :- Used: 97.15%
    • Total :- 100 MB
    • Used :- 97.15 MB
    • Free :- 2.85 MB
      Write Load Period

Disk

  • / :- Used: 95.07%
    • Total :- 3.92 GB
    • Used :- 3.73 GB
    • Free :- 0 B
    • Write Load :- 2.7 KB/s (11 days 21 hours 14 mins)
  • /boot :- Used: 20.55%
    • Total :- 252.05 MB
    • Used :- 51.79 MB
    • Free :- 200.25 MB
    • Write Load :- 0 B/s (11 days 21 hours 14 mins)
  • /var/opt/emoncms :- Used: 10.83%
    • Total :- 24.76 GB
    • Used :- 2.68 GB
    • Free :- 20.97 GB
    • Write Load :- 650.2 B/s (11 days 21 hours 14 mins)
  • /var/log :- Used: 19.00%
    • Total :- 50 MB
    • Used :- 9.5 MB
    • Free :- 40.5 MB
    • Write Load :- n/a

HTTP

  • Server :- Apache/2.4.38 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.17-MariaDB-0+deb10u1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2020-02-10 18:48:58 (UTC 00:00‌​)
  • Stats :- Uptime: 1988940 Threads: 16 Questions: 25259306 Slow queries: 0 Opens: 62 Flush tables: 1 Open tables: 54 Queries per second avg: 12.699

Redis

  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.0.2
  • Host :- localhost:6379
  • Size :- 682 keys (1.78M)
  • Uptime :- 23 days

MQTT Server

  • Version :- Mosquitto 1.5.7
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.3.11-1~deb10u1 (Zend Version 3.3.11)
  • Modules :- apache2handler | calendar v7.3.11-1~deb10u1 | Core v7.3.11-1~deb10u1 | ctype v7.3.11-1~deb10u1 | curl v7.3.11-1~deb10u1 | date v7.3.11-1~deb10u1 | dom v20031129 | exif v7.3.11-1~deb10u1 | fileinfo v7.3.11-1~deb10u1 | filter v7.3.11-1~deb10u1 | ftp v7.3.11-1~deb10u1 | gd v7.3.11-1~deb10u1 | gettext v7.3.11-1~deb10u1 | hash v7.3.11-1~deb10u1 | iconv v7.3.11-1~deb10u1 | json v1.7.0 | libxml v7.3.11-1~deb10u1 | mbstring v7.3.11-1~deb10u1 | mosquitto v0.4.0 | mysqli v7.3.11-1~deb10u1 | mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $ | openssl v7.3.11-1~deb10u1 | pcre v7.3.11-1~deb10u1 | PDO v7.3.11-1~deb10u1 | pdo_mysql v7.3.11-1~deb10u1 | Phar v7.3.11-1~deb10u1 | posix v7.3.11-1~deb10u1 | readline v7.3.11-1~deb10u1 | redis v5.0.2 | Reflection v7.3.11-1~deb10u1 | session v7.3.11-1~deb10u1 | shmop v7.3.11-1~deb10u1 | SimpleXML v7.3.11-1~deb10u1 | sockets v7.3.11-1~deb10u1 | sodium v7.3.11-1~deb10u1 | SPL v7.3.11-1~deb10u1 | standard v7.3.11-1~deb10u1 | sysvmsg v7.3.11-1~deb10u1 | sysvsem v7.3.11-1~deb10u1 | sysvshm v7.3.11-1~deb10u1 | tokenizer v7.3.11-1~deb10u1 | wddx v7.3.11-1~deb10u1 | xml v7.3.11-1~deb10u1 | xmlreader v7.3.11-1~deb10u1 | xmlwriter v7.3.11-1~deb10u1 | xsl v7.3.11-1~deb10u1 | Zend OPcache v7.3.11-1~deb10u1 | zlib v7.3.11-1~deb10u1

Pi

  • Model :- Raspberry Pi 3 Model B Rev 1.2 - 1GB (Sony UK)

  • Serial num. :- 43DDB2EE

  • Temperature :- 63.91°C - 64.5°C

  • emonpiRelease :- emonSD-17Oct19

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
  • Language :- en-US,en;q=0.5

Window

  • Size :- 1903 x 966

Screen

  • Resolution :- 1920 x 1080

Yes it will. If you search you will find a couple of other treads here on this. Do a search on the system for any large files an old backup files and delete them. The system needs enough space to be able to create the backup.

Ultimately, you might want to consider migrating to a larger card.

I though we’d fixed this @TrystanLea.

The issue is the backup is not saving to the larger partition. It should be using /var/opt/emoncms but is actually using /opt/openenergymonitor/data/.

You can edit the backup configuration file to point to a different place.

I could edit the file, but then that would make my setup not normal.

I had the same problem restoring the backup.

Can you please post the contents of the config.cfg that in in the module directory that I think will be at

/opt/emoncms/modules/backup

Looking at what the install script does…

I think the right way is to change the BACKUP_LOCATION item from /opt/openenergymonitor/data to /var/opt/emoncms/backup

In addition, the related item BACKUP_SOURCE_PATH needs to change to /var/opt/emoncms/backup/uploads

The folders are subsequently created by the install script,

sudo mkdir /var/opt/emoncms/backup
sudo mkdir /var/opt/emoncms/backup/uploads

but the install script has hard-coded chown user and group - these should be fine for you.

sudo chown pi:pi /var/opt/emoncms/backup -R 
sudo chown www-data:pi /var/opt/emoncms/backup/uploads -R 

The install script should use the install.ini values - I have raised an Issue re the chown commands.

I have also raised an issue re correcting the paths and moving the contents on an emoncms update

While your emoncms core version is up to date @Pukka the backup module is one version behind the latest version and should explain why the new backup location has not been created and setup. Can you run the updater again?

Just had a look and its because i have edited the usb-import.sh file.

Do you know the git command that I need to run to overwrite the file?

Paul

If you go into the folder and try git pull it will tell you. From memory it is

git checkout -- <FILENAME>

If you want to keep your changes, do a git stash before and a git stash pop after a git pull.

Thanks @borpin that sorted it and the backup worked. I also needed to go to the old area and delete the failed backups

1 Like