Kategorien
Blog Software

Raspberry Pi backup

I was struggeling recently as I somehow „destroyed“ the operating system of my RPi. So I wanted to setup a better Raspberry Pi backup solution.

The existing solution saved me, true, but we can do better. I had the following setup running:

  • Updraft for all the wordpress content. This really saved me. A very nice backup solution. The restore was easy and worked. Google drive is used as storage for the backup.
  • A regular backup of the mysql db with automysqlbackup. The backup also worked, but it’s quite difficult to make a restore. This is recommended if you have other applications except wordpress that use the database.
    The backup was saved to an USB flash drive mounted to the RPi.
  • An rsync backup of the most important config files under /etc.
    The backup was saved to the same USB flash drive mounted to the RPi.
Raspberry Pi backup
Backup, Backup, Backup,…

New backup solution

The new solution now looks like that:

  • I’m still using Updraft for all the wordpress content and system. Google drive is used as storage for the backup.
  • Optional: A regular backup of the mysql db with automysqlbackup. The backup also works, but it’s quite difficult to make a restore. If you are starting from scratch you have to create the database, users and privileges before importing the content of the database.
    This is recommended if you have other applications except wordpress that use the mysql database.
    The backup is saved to an USB flash drive mounted to the RPi.
  • The script raspiBackup saves now both partitions of the RPi file system. Mine are both located on a hard drive, but of course it can be on the S(S)D card as well.
    So you need a mounted drive where you wanna save the complete backup and for the restore you need either a linux system with the script running or another RPi.
    If you are using the „dd“ method you can also use a windows system.

If you wanna be notified when the backup was running, hopefully successful, you need an mail client.

I was trying to install ssmtp as an e-mail client, but was not successful, so I switched to the – for me – well known exim4.

You can install it based on this tutorial.

Be aware when using it with a google mail account that you have to enable the feature lesssecureapps.

With that solution I’m able to restore the live RPi system reliably much faster with all the data.

Kategorien
News Software

Baidu’s computer for self-driving cars is ready

Here we go, Baidu’s computer for self-driving cars is ready to go.

How long do we have to wait till we can use it and just relax in the car while being driven by a non-human driver?

And where’s an US company, by the way, that always wants to be first?

I have a lot of respect for Tesla, but we see that some Chinese companies are very close. Europeans are far behind.

Baidu's computer for self-driving cars
Tata or Baidu?

https://www.engadget.com/baidu-self-driving-car-computer-ready-081925160.html

Kategorien
Blog News Software

Hackers remotely control a Mercedes-Benz

Some time ago we had that already with a Jeep. And it happen again that hackers remotely control a Mercedes-Benz or another car.

Or is that the new mode of automatic driving? 😉

Hackers remotely control a Mercedes-Benz
Not a Mercedes-Benz

http://feedproxy.google.com/~r/Techcrunch/~3/aKkMJmaZwRU/

Kategorien
Blog Software

Raspbian Upgrade kills the RaspberryPi

It all started that I wanted to upgrade the PHP from version 7.0 to version 7.3/4, because wordpress was blaming about it. And I never would have imagined that an Raspbian Upgrade kills the RaspberryPi.

But first things first, that’s how the story goes that occupied my for two days.

Raspbian Upgrade kills the RaspberryPi

The base version of my Raspbian is Jessie, running on a standard RPi version 3. So I wanted to fetch the 7.3 PHP packages from the buster version of Raspbian. But I was unable to finish that process as the upgrade said, I had to break the 7.0. So I was afraid and stopped it.

The result was, that the system was completely messed up. The curl to the HTTPS world was no longer working. And I saw that even the udev package had some unmet dependencies. So I rebooted the system and it stopped completely while booting.

First attempt

What to do now?

I decided to install raspbian buster on a new hard disc (I once configured the RPi to boot directly from the USB hard drive) and install all the necessary applications based on the following tutorials:

https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress

https://bitreporter.de/raspberrypi/webserver-mit-wordpress-blog-auf-dem-raspberry-pi-einrichten/

For configuring the php fpm module I used https://tecadmin.net/install-apache-php-fpm-debian-10/

The last software part was getting an HTTPS certificate from let’s encrypt based on https://pimylifeup.com/raspberry-pi-ssl-lets-encrypt/

All these are really very good tutorials and worked like a charm (I just replaced once the mysql-server with mariadb-server). For connecting to the WordPress jetpack service you need also php-xml to be installed.

Fortunately I was performing a regular backup of the system with updraft. The restore worked perfectly. I was also using standard backups of the system that helped me a bit, but due to the HDD configuration I did not have a backup that I just could use, e.g. like an image to copy on the hard disk.

As I have a bit of a special wordpress installation (site URL != wordpress URL) I had to move the wordpress directory from „html“ to „wordpress“ and had to adapt the apache vhost configuration slightly.

After configuring all that the site was up and running again after around 5h.

So I thought, „Ok, let’s make a reboot.“ And the system stopped during boot.

What a shit!

The error message was:

usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
usb usb1-port1: attempt power cycle

„Ok“ I thought as I was using a quite old hard disc, maybe it’s somthing wrong with the cable now. I decided to just flash the fine running hard disc of my former life system and do the process again (I was faster now, took me just 3h!)

Second attempt

After configuring everthing again, I made the reboot and…the system stopped again with the same error message.

„Ok, it cannot be that we are having here now exactly the same hardware problem with another hardware. So it must be a software issue. What did I do except just the install of new software? What was hardware related?“

There was one command:

pi@raspberrypi3:~ $ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
ca-certificates firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek
libgnutls30 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 raspberrypi-bootloader
raspberrypi-kernel raspi-config rpi-eeprom rpi-eeprom-images
16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 127 MB of archives.
After this operation, 6,477 kB disk space will be freed.
Do you want to continue? [Y/n]

After issuing this command the system did not boot anymore.

Final attempt

So, I did the installation process a third time (2h now), this time without the upgrade, and the system just works.

Since 2013 I’m working with this setup and it never happened that an upgrade of the operating system resulted in such a disaster!

Update from 16.08.2020

It works now. I did the upgrade in some package chunks to find out which packge caused the problem with the command:

sudo apt-get install --only-upgrade <package-name>

But I think it would have been not necessary. I have no idea, which package was changed in the mean time.

Kategorien
Blog News Software

Facebook under pressure

Currently Facebook is under pressure.

But I’m not sure if bigger changes of Facebook will happen.

Facebook under pressure
Facebook and Co

Mark Zuckerberg is super smart, in a negative way. He’s not committing to anything that is hurting himself and Facebook, respectively.

And that is in big contrast how the boss of twitter, Jack Dorsey, is acting. With him I see the commitment to change something, that he will no longer accept hate speech and racism on his plattform.

https://www.engadget.com/what-does-facebook-ad-boycott-accomplish-231311517.html