Can't get backup to work. **solved**

This section covers the Meteobridge PRO, NANO SD and Raspberry Pi units exclusively

Moderator: Mattk

Post Reply
azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Can't get backup to work. **solved**

Post by azchrisf »

I'm trying to run the standard backup script (backup.sh) on the Raspberry Pi as a service. I have entered "backup.bak" as the filename, and I have a USB stick plugged in next to the Meteostick, but all I get from the console log:


backup (10.03.2021 14:46:56): no target media found.

Any help?

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6631
Joined: Mon Oct 01, 2007 10:51 pm

Re: Can't get backup to work

Post by admin »

Where do you enter the backup name? Can you please share a screen dump.

Please distinguish between backup of settings and data. backup.sh does a backup of data and I can't remember that you can give it a name.
Which format does the USB stick have?

azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Re: Can't get backup to work

Post by azchrisf »

I'm doing it in Services. Yes, i"m trying to backup the database (data).
The USB stick is FAT32 formatted.
Snap1.png
Snap1.png (37.52 KiB) Viewed 497 times

azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Re: Can't get backup to work

Post by azchrisf »

I reformatted the disk to ext4, and I can see that the system sees it when I do "fdisk", it's listed as "sda".
No matter what I do it still thinks "there is no media". I manually edited the file and replaced the ls -C /dev/sd?1 2>/dev/null | cut -f1` with just /dev/sda and it worked.

However, I have a database from a Pro Red I need to restore (I have the dbase files), but there is nowhere in the Webpage to select the database, or anything listed under restore from?

Gyvate
Expert Boarder
Expert Boarder
Posts: 126
Joined: Thu May 14, 2020 4:36 pm

Re: Can't get backup to work

Post by Gyvate »

azchrisf wrote:
Fri Mar 12, 2021 6:04 pm
I reformatted the disk to ext4, and I can see that the system sees it when I do "fdisk", it's listed as "sda".
No matter what I do it still thinks "there is no media". I manually edited the file and replaced the ls -C /dev/sd?1 2>/dev/null | cut -f1` with just /dev/sda and it worked.

However, I have a database from a Pro Red I need to restore (I have the dbase files), but there is nowhere in the Webpage to select the database, or anything listed under restore from?
If you put the database backup on a normal FAT32 formatted USB stick and insert the stick to the RPi, you should be able to select it.
Maybe a reboot is needed before it becomes visible.

If this doesn't work, there is still another way via SSH - you can mount your USB stick to a directory in the MB file system and copy it into the folder where the database resides.
e.g.
mkdir /tmp/mnt/USB
mount /dev/sda1 /tmp/mnt/USB

(assuming your USB stick is the special/serial device a and its partition 1, sda1 - that's usually the case unless you have more USB storage devices connected to your RPi)
cp /tmp/mnt/USB/dbase-yyyymmddHHMM /tmp/mnt
(yyyymmddHHMM is the time stamp of your DB backup)

then your backup database will be in the same directory as your actual database and then you should be able to select it for restore.
(that's what I needed to do earlier - meanwhile Boris has updated MB for RPi and you can see the external USB device from the restore drop-down)
WH4000SE 1.5.8/GW1000 1.6.6/HP1000SE Pro 1.7.1/WH2650 1.6.7-ß
2xMeteobridge Pro [B+R],RPi4-2/16
Ecowitt 5763, 5764; WU ISAARB3; ISAARB22; Weathercloud 3011399141; http://meshka.eu/meteo/template - http://meshka.eu/Weather34

azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Re: Can't get backup to work

Post by azchrisf »

Thanks!

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6631
Joined: Mon Oct 01, 2007 10:51 pm

Re: Can't get backup to work

Post by admin »

azchrisf wrote:
Fri Mar 12, 2021 6:04 pm
I reformatted the disk to ext4, and I can see that the system sees it when I do "fdisk", it's listed as "sda".
No matter what I do it still thinks "there is no media". I manually edited the file and replaced the ls -C /dev/sd?1 2>/dev/null | cut -f1` with just /dev/sda and it worked.
When you get a USB stick from factory it has a partition and this holds FAT32 or alike filesystem. Looks like you removed the partition and directly brought a filesystem onto it. When you tell Meteobridge to use the external stick as the primary data volume, then Meteobridge removes the partition information from it and puts an ext4 directly onto it. May be you played with the external stick that way and now you don't understand what happened. Using external sticks as primary storage media is in general a very very bad idea but some can't step away from it dreaming of more cheap storage... May be I disable that option completely as so much silly things happen with this option. It was meant to fix situations when internal stick fails and you need an urgent work around.

Please get your stick formatted/partitioned correctly instead of patching scripts, which will only move you further down the road ruining your setup.

azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Re: Can't get backup to work

Post by azchrisf »

admin wrote:
Mon Mar 15, 2021 10:53 pm
azchrisf wrote:
Fri Mar 12, 2021 6:04 pm
I reformatted the disk to ext4, and I can see that the system sees it when I do "fdisk", it's listed as "sda".
No matter what I do it still thinks "there is no media". I manually edited the file and replaced the ls -C /dev/sd?1 2>/dev/null | cut -f1` with just /dev/sda and it worked.
When you get a USB stick from factory it has a partition and this holds FAT32 or alike filesystem. Looks like you removed the partition and directly brought a filesystem onto it. When you tell Meteobridge to use the external stick as the primary data volume, then Meteobridge removes the partition information from it and puts an ext4 directly onto it. May be you played with the external stick that way and now you don't understand what happened. Using external sticks as primary storage media is in general a very very bad idea but some can't step away from it dreaming of more cheap storage... May be I disable that option completely as so much silly things happen with this option. It was meant to fix situations when internal stick fails and you need an urgent work around.

Please get your stick formatted/partitioned correctly instead of patching scripts, which will only move you further down the road ruining your setup.
Boris,
This is a 2 part issue. The first was backing up the existing, new MB to a USB stick, and the second was taking an old DB from another unit and copying it to the new MB.

For the 1st...First off it didn't work formatted out of the box with FAT32.
Second I'm not using it as primary storage, the industrial SD card is the primary DB storage. This USB stick was inserted to be used for backing up the database to incase of failure/emergency.

The backup/restore issue is a seperate database on a seperate USB drive.

But thank you.

azchrisf
Senior Boarder
Senior Boarder
Posts: 40
Joined: Thu Aug 17, 2017 5:30 am

Re: Can't get backup to work. **solved**

Post by azchrisf »

And also, Boris, I have to ask, why do you chastise me when your own built in backup script did not detect the device (which is /dev/sda1...) and I had to modify it?

I would think it would be better to help than to condem.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6631
Joined: Mon Oct 01, 2007 10:51 pm

Re: Can't get backup to work. **solved**

Post by admin »

Your observation ist wrong. Backup and restores works fine now with a standard partitioned USB stick. I have tested this.

"How I fixed a bug" postings on non-bugs are not something I give a warm welcome here. Nothing personal.

Post Reply