# Backup ran out of space

**URL:** <https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284>\
**Category:** Emoncms\
**Created:** [10 February 2020 18:49 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284 "2020-02-10T18:49:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pukka](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@Pukka](https://community.openenergymonitor.org/u/Pukka)\
**Post date:** [10 February 2020 18:49 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/1 "2020-02-10T18:49:28Z")

</div>

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

```auto
=== 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
> 
> - **Version** :- low-write 10.2.0
> - **Modules** :- Administration | App v2.1.0 | Backup v2.2.0 | EmonHub Config v2.0.4 | Dashboard v2.0.6 | DemandShaper v1.2.0 | Device v2.0.4 | EventProcesses | Feed | Graph v2.0.8 | Input | Postprocess v2.1.2 | CoreProcess | Schedule | Network Setup v1.0.0 | sync | Time | User | Visualisation | WiFi v2.0.2
> - **Git** :-
> - **URL** :- [GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data](https://github.com/emoncms/emoncms.git)
> - **Branch** :- \* stable
> - **Describe** :- 10.2.0
> 
> ## 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

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 February 2020 09:16 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/2 "2020-02-11T09:16:03Z")

</div>

~~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.

---

<div class="post-metadata">

**Author:** ![Pukka](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@Pukka](https://community.openenergymonitor.org/u/Pukka)\
**Post date:** [11 February 2020 09:53 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/3 "2020-02-11T09:53:35Z")

</div>

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

I had the same problem restoring the backup.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 February 2020 12:17 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/4 "2020-02-11T12:17:06Z")

</div>

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

```auto
/opt/emoncms/modules/backup

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 February 2020 12:50 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/5 "2020-02-11T12:50:13Z")

</div>

Looking at what the [install script](https://github.com/emoncms/backup/blob/master/install.sh) 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,

```auto
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.

```auto
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.

> <https://github.com/emoncms/backup/issues/55>
>
> These 2 \`chown \` commands have hardcoded ownership.
> 
> https://github.com/emoncm…s/backup/blob/4f86e1ab294ec21fec8529990534c54a21c97ebe/install.sh#L84
> 
> https://github.com/emoncms/backup/blob/4f86e1ab294ec21fec8529990534c54a21c97ebe/install.sh#L92

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

> <https://github.com/openenergymonitor/EmonScripts/issues/79>
>
> The location for backups has been changed recently.
> 
> There will still be users… with the old locations. Backups will fail due to a lack of space in the partition.
> 
> The update script needs to update the backup config file and move the folders and their contents.
> 
> Discussion refers
> https://community.openenergymonitor.org/t/backup-ran-out-of-space/

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [12 February 2020 11:08 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/6 "2020-02-12T11:08:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Pukka](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@Pukka](https://community.openenergymonitor.org/u/Pukka)\
**Post date:** [12 February 2020 11:43 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/7 "2020-02-12T11:43:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [12 February 2020 13:34 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/8 "2020-02-12T13:34:46Z")

</div>

> [@Pukka](#):
>
> Do you know the git command that I need to run to overwrite the file?

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

```auto
git checkout -- <FILENAME>

```

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

---

<div class="post-metadata">

**Author:** ![Pukka](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@Pukka](https://community.openenergymonitor.org/u/Pukka)\
**Post date:** [14 February 2020 16:02 UTC](https://community.openenergymonitor.org/t/backup-ran-out-of-space/13284/9 "2020-02-14T16:02:12Z")

</div>

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