OpenHab3: automatyc...
 
Powiadomienia
Wyczyść wszystko

OpenHab3: automatyczny backup na drugą kartę pamięci

7 Wpisów
2 Użytkownicy
1 Likes
805 Wyświetleń
(@edass)
Wpisów: 216
Weteran
Autor tematu
 

Widzieliście, że dodali automatyczny backup na drugą kartę pamięci?  Wystarczy czytnik kart i karta pamięci o pojemności nie mniejszej niż ta z systemem. 

 
Dodane : 29/12/2020 10:01 pm
adrian reacted
 g6pl
(@g6pl)
Wpisów: 17
Praktykant
 
Dodane przez: @edass

Widzieliście, że dodali automatyczny backup na drugą kartę pamięci?  Wystarczy czytnik kart i karta pamięci o pojemności nie mniejszej niż ta z systemem. 

A gdzie ta opcja jest?

 
Dodane : 31/12/2020 6:33 pm
(@edass)
Wpisów: 216
Weteran
Autor tematu
 

Łap

sudo openhabian-config
50 Backup/Restore

 

https://www.openhab.org/docs/installation/openhabian.html#auto-backup

Auto-backupYou might want to setup openHABian to automatically backup and mirror your internal SD card to an external unit. We suggest to use another SD card in an external card writer device so that in case your internal SD card fails, you can switch SD cards to get the system back up running fast. Note most "16GB" cards are not exactly 16 GB and your new one mustn't have less bytes than the old one so openHABian enforces the second card to have at least twice the size of your internal card. We make use of that extra space as storage for the backup system.To setup right at installation time: Define backupdrive=/dev/sdX (replace X with the proper character) to enable this functionality right during unattended installation. Eventually change storagedir=/storage to any other name. The first attached disk type device is usually called /dev/sda. openHABian will create partitions 1 and 2 to be mirrors of your internal card and will assign the remaining space to a storage partition. Full mirroring will take place semiannually and for the 2nd partition (Linux root), changes will be synced once a week. See systemctl list-timers, timers are defined in /etc/systemd/system/sd*.timer. The unattended install routine will also setup Amanda to take daily backups and store them to that third partition. Use storagecapacity=xxx to override how much space to consume at most for Amanda backup storage (in MB). If you choose to skip this during system installation, you can still setup both, mirroring and Amanda, at any later time using the 5X menu options.Menu 5X provides interactive access to the aforementioned functions: 53 Setup SD monitoring prepares the partitions on an SD card and sets up timers to execute both, a full mirroring and complementary rsync 'diff' runs in a backup schedule. 54 Raw copy SD is a one-time raw copy (mirror) run. 55 Sync SD proagates (syncs) differences from your main SD card to your external card.Should you need to switch over to your backup card, get a another new SD card to match the size of the broken card and use menu option 54 to copy your active backup card back to the new one and switch cards back as soon as possible.

 
Dodane : 31/12/2020 6:49 pm
 g6pl
(@g6pl)
Wpisów: 17
Praktykant
 

@edass

Hej, dzięki za info, tylko ja nie mam polecenia openhabian-config ... sam instalowałem od zera

 
Dodane : 01/01/2021 1:48 pm
(@edass)
Wpisów: 216
Weteran
Autor tematu
 

Wpisz w konsoli

sudo openhabian-config

powinno Cię zapytać o hasło do konsoli (np. połącz się z serwerem przez putty ) - podajesz i pojawi się narzędzie do konfiguracji OH. Tam strzałkami wybierasz 

50 Backup/Restore

 

i dalej musisz doczytać bo ja jeszcze tego nie robiłem ( ale mam zamiar).

 

 
Dodane : 01/01/2021 3:33 pm
 g6pl
(@g6pl)
Wpisów: 17
Praktykant
 

 openhabian-config - nie istnieje w czystej instalacji, ale za to istnieje: sudo openhab-cli backup

 
Dodane : 03/01/2021 9:34 pm
(@edass)
Wpisów: 216
Weteran
Autor tematu
 

Teoretycznie uruchomiłem ten backup ale nie mam pewności czy to działa...

W instrukcji jest napisane, że ma się robić regularnie sam ale jak to zweryfikować? 

 

Poniżej log z pierwszego przebiegu:

[17:38:32] openhabian@openHABianDevice:~$ sudo openhabian-config
[sudo] password for openhabian:
2021-01-05_18:04:47_CET [openHABian] Checking for root privileges... OK
2021-01-05_18:04:48_CET [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2021-01-05_18:04:48_CET [openHABian] openHABian configuration tool version: [openHAB3]patchday-20210104-1099(5f69103)
2021-01-05_18:04:48_CET [openHABian] Checking for changes in origin branch openHAB3... OK
2021-01-05_18:04:52_CET [openHABian] Switching to branch openHAB3... OK
2021-01-05_18:04:56_CET [openHABian] Setting up automated SD mirroring and backup... OK
/opt/openhabian/functions/backup.bash: line 511: to: command not found
Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 29.5 GiB, 31708938240 bytes, 61931520 sectors
Disk model: Mass-Storage
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf6e5d0f8

Old situation:

Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/sda2 532480 31291391 30758912 14.7G 83 Linux
/dev/sda3 31291392 61931519 30640128 14.6G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x7de9caa0.
/dev/sda1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 256 MiB.
Partition #1 contains a vfat signature.
/dev/sda2: Created a new partition 2 of type 'Linux' and of size 14.7 GiB.
Partition #2 contains a ext4 signature.
/dev/sda3: Created a new partition 3 of type 'Linux' and of size 14.6 GiB.
Partition #3 contains a ext4 signature.
/dev/sda4: Done.

New situation:
Disklabel type: dos
Disk identifier: 0x7de9caa0

Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/sda2 532480 31291391 30758912 14.7G 83 Linux
/dev/sda3 31291392 61931519 30640128 14.6G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
^[[A^[[BOK
/opt/openhabian/functions/backup.bash: line 422: mail: command not found
OK
OK
2021-01-05_18:32:20_CET [openHABian] Checking for default openHABian username:password combination... OK
2021-01-05_18:32:20_CET [openHABian] We hope you got what you came for! See you again soon ;)
[18:32:20] openhabian@openHABianDevice:~$


 
Dodane : 05/01/2021 7:59 pm
Udostępnij: