Archive for the ‘Banana Pi’ Category

Banana Pi BPI-W3 – is a router based development board

Sonntag, Juli 24th, 2022

Banana Pi BPI-M1 – how to work remote with SSHFS and BorgBackup 1.2.0-1 with an official linux package on Armbian Linux Jammy

Freitag, Juli 15th, 2022

root@bpi-iot-jsho-borg-02:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:qEVnZhnHaQSSZw60HpegRqTUqd/LZp/hu4MzQDz2ohM root@bpi-iot-jsho-borg-02
The key’s randomart image is:
+—[RSA 3072]—-+
| .ooo+.o+o. |
| . oo.o+o=+ |
| .oo +=O. |
| ..=o O. |
| + ++ S |
| E +oo |
| o.+ o. |
| o O..o |
| . o +*+ |
+—-[SHA256]—–+
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# ssh-copy-id -f root@bpi-iot-jsho-rslsync-01
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: „/root/.ssh/id_rsa.pub“
root@bpi-iot-jsho-rslsync-01’s password:
Number of key(s) added: 1
Now try logging into the machine, with: „ssh ‚root@bpi-iot-jsho-rslsync-01′“
and check to make sure that only the key(s) you wanted were added.
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# service ssh restart
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# ssh bpi-iot-jsho-rslsync-01 uname -a
Linux bpi-iot-jsho-rslsync-01 5.15.48-sunxi #22.05.3 SMP Wed Jun 22 07:35:10 UTC 2022 armv7l armv7l armv7l GNU/Linux
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:/# apt-get install sshfs
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# sshfs root@bpi-iot-jsho-rslsync-01:/resilio-sync.data /mnt/sshfs
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 99044 4528 94516 5% /run
/dev/mmcblk0p1 117933592 7218400 109436900 7% /
tmpfs 495212 0 495212 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 495212 4 495208 1% /tmp
/dev/zram1 47960 9116 35260 21% /var/log
tmpfs 99040 68 98972 1% /run/user/110
tmpfs 99040 60 98980 1% /run/user/0
root@bpi-iot-jsho-rslsync-01:/resilio-sync.data 60172896 6733472 52752824 12% /mnt/sshfs
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:/# borg init –encryption=repokey /borgbackup.data2
Enter new passphrase: <password>
Enter same passphrase again: <password>
Do you want your passphrase to be displayed for verification? [yN]: n
By default repositories initialized with this version will produce security
errors if written to with an older version (up to and including Borg 1.0.8).
If you want to use these older versions, you can disable the check by running:
borg upgrade –disable-tam /borgbackup.data2
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
If you used a repokey mode, the key is stored in the repo, but you should back it up separately.
Use „borg key export“ to export the key, optionally in printable format.
Write down the passphrase. Store both at safe place(s).
root@bpi-iot-jsho-borg-02:/#
root@bpi-iot-jsho-borg-02:~# borg create –compression lz4 –stats /borgbackup.data2::`date „+Backup-%Y-%m-%d-%H:%M:%S“` /mnt/sshfs
Enter passphrase for key /borgbackup.data2: <password>
——————————————————————————
Repository: /borgbackup.data2
Archive name: Backup-2022-13-13-13:35:03
Archive fingerprint: adcc8f6a6c8ab36341c9b055a07d0734264c34a5b6c58f5277d2de9d327b30f7
Time (start): Wed, 2022-07-13 13:35:14
Time (end): Wed, 2022-07-13 13:45:11
Duration: 9 minutes 56.65 seconds
Number of files: 2467
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 1.28 GB
All archives: 2.10 GB 1.29 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2740 3051
——————————————————————————
root@bpi-iot-jsho-borg-02:~#

 

root@bpi-iot-jsho-borg-02:~# borg create –compression lz4 –stats /borgbackup.data2::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /mnt/sshfs
Enter passphrase for key /borgbackup.data2: <password>
——————————————————————————
Repository: /borgbackup.data2
Archive name: Backup-2022-13-13-14:14:26
Archive fingerprint: 3aee10863931c82a62355561a59f33b3f26c92621933993b19fdf31d7a2a6afa
Time (start): Wed, 2022-07-13 14:14:39
Time (end): Wed, 2022-07-13 14:15:09
Duration: 29.87 seconds
Number of files: 2467
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 719 B
All archives: 4.20 GB 2.58 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2741 6102
——————————————————————————
root@bpi-iot-jsho-borg-02:~#

 

root@bpi-iot-jsho-borg-02:~# borg create –compression lz4 –stats /borgbackup.data2::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /mnt/sshfs
Enter passphrase for key /borgbackup.data2: <password>
——————————————————————————
Repository: /borgbackup.data2
Archive name: Backup-2022-13-13-15:04:05
Archive fingerprint: 8703aa110e9519005954f475e822be179be02b19e91b13ab18ae5d6ee1f1ded8
Time (start): Wed, 2022-07-13 15:04:16
Time (end): Wed, 2022-07-13 15:04:46
Duration: 29.79 seconds
Number of files: 2467
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 716 B
All archives: 6.30 GB 3.87 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2742 9153
——————————————————————————

root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# umount /mnt/sshfs
root@bpi-iot-jsho-borg-02:~# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 99044 4520 94524 5% /run
/dev/mmcblk0p1 117933592 7218412 109436888 7% /
tmpfs 495212 0 495212 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 495212 4 495208 1% /tmp
/dev/zram1 47960 9168 35208 21% /var/log
tmpfs 99040 68 98972 1% /run/user/110
tmpfs 99040 60 98980 1% /run/user/0
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# vi borgbackup.sh
#!/bin/bash
#FileName: borgbackup.sh
set -x
export BORG_PASSCOMMAND=“cat /root/.borg-passphrase“
sshfs root@bpi-iot-jsho-rslsync-01:/resilio-sync.data /mnt/sshfs
borg create –compression lz4 –stats /borgbackup.data2::`date „+Backup-%Y-%m-%d-%H:%M:%S“` /mnt/sshfs
borg prune -v –list –keep-within 3d –keep-daily 7 –keep-weekly 12 –keep-monthly 12 –keep-yearly 5 /borgbackup.data2
borg compact /borgbackup.data2
borg list /borgbackup.data2
umount /mnt/sshfs
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use ‚*‘ in these fields (for ‚any‘).
#
# Notice that tasks will be started based on the cron’s system
# daemon’s notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
15 * * * * /root/borgbackup.sh >> /root/borgbackup.log 2>&1
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# borg check -v /borgbackup.data2
Starting repository check
finished segment check at segment 199
Starting repository index check
Index object count match.
Finished full repository check, no problems found.
Starting archive consistency check…
Enter passphrase for key /borgbackup.data2: <password>
Analyzing archive Backup-2022-07-16-15:41:39 (1/24)
Analyzing archive Backup-2022-07-16-15:54:01 (2/24)

Analyzing archive Backup-2022-07-17-11:15:04 (23/24)
Analyzing archive Backup-2022-07-17-12:15:05 (24/24)
Archive consistency check complete, no problems found.
root@bpi-iot-jsho-borg-02:~#

Banana Pi BPI-M1 – how to install BorgBackup 1.2.0-1 with an official linux package on Armbian Linux Jammy

Dienstag, Juli 5th, 2022

BorgBackup – a deduplicating archiver with compression and encryption

root@bpi-iot-jsho-borg-01:~# apt-get update -y
root@bpi-iot-jsho-borg-01:~# apt-get install borgbackup
root@bpi-iot-jsho-borg-01:~# borg –version
borg 1.2.0
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# mkdir /borgbackup.data
oot@bpi-iot-jsho-borg-01:~# borg init –encryption=repokey /borgbackup.data
Enter new passphrase: <password>
Enter same passphrase again: <password>
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:/# borg create –stats /borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
Enter passphrase for key /borgbackup.data: <password>
——————————————————————————
Repository: /borgbackup.data
Archive name: Backup-2022-01-01-12:42:07
Archive fingerprint: c98f79eb4e84b0b0a49877d394ef2de27517e4f8126c0f140bbc40fdf743cda5
Time (start): Fri, 2022-07-01 12:42:18
Time (end): Fri, 2022-07-01 12:49:06
Duration: 6 minutes 48.81 seconds
Number of files: 2438
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 1.28 GB
All archives: 2.10 GB 1.29 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2747 3049
——————————————————————————

root@bpi-iot-jsho-borg-01:/#
root@bpi-iot-jsho-borg-01:/# borg list /borgbackup.data
Enter passphrase for key /borgbackup.data: <password>
Backup-2022-01-01-12:42:07 Fri, 2022-07-01 12:42:18 [c98f79eb4e84b0b0a49877d394ef2de27517e4f8126c0f140bbc40fdf743cda5]
root@bpi-iot-jsho-borg-01:/#
root@bpi-iot-jsho-borg-01:/# borg delete /borgbackup.data::Backup-2022-01-01-12:42:07
Enter passphrase for key /borgbackup.data: <password>
root@bpi-iot-jsho-borg-01:/#

Use lz4 compression – very fast but low compression ratio (default)

root@bpi-iot-jsho-borg-01:/# borg create –compression lz4 –stats /borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
Enter passphrase for key /borgbackup.data: <password>
——————————————————————————
Repository: /borgbackup.data
Archive name: Backup-2022-01-01-13:05:31
Archive fingerprint: cbbdef87b74dac396d5028612f000045a1499f3e1dcf6fe6976f4179b41f7fa8
Time (start): Fri, 2022-07-01 13:05:42
Time (end): Fri, 2022-07-01 13:12:29
Duration: 6 minutes 46.94 seconds
Number of files: 2438
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 1.28 GB
All archives: 2.10 GB 1.29 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2746 3048
——————————————————————————

root@bpi-iot-jsho-borg-01:/#
root@bpi-iot-jsho-borg-01:/# borg list /borgbackup.data
Enter passphrase for key /borgbackup.data: <password>
Backup-2022-01-01-13:05:31 Fri, 2022-07-01 13:05:42 [cbbdef87b74dac396d5028612f000045a1499f3e1dcf6fe6976f4179b41f7fa8]

root@bpi-iot-jsho-borg-01:/#
root@bpi-iot-jsho-borg-01:/# borg create –compression lz4 –stats /borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
Enter passphrase for key /borgbackup.data: <password>
——————————————————————————
Repository: /borgbackup.data
Archive name: Backup-2022-01-01-13:25:25
Archive fingerprint: 5ecf2025dce21c495375df43995205139b20275ed630511a91c071da5364c70f
Time (start): Fri, 2022-07-01 13:25:36
Time (end): Fri, 2022-07-01 13:25:45
Duration: 9.16 seconds
Number of files: 2440
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 2.87 kB
All archives: 4.20 GB 2.58 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2750 6098
——————————————————————————

root@bpi-iot-jsho-borg-01:/#

To specify a passphrase without human intervention is to create a file with a password in it in your home directory and use permissions to keep anyone else from reading it

root@bpi-iot-jsho-borg-01:~# (umask 0077; head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase)
root@bpi-iot-jsho-borg-01:~# export BORG_PASSCOMMAND=“cat $HOME/.borg-passphrase

The prune command prunes a repository by deleting all archives not matching any of the specified retention options

# Keep 7 end of day 4 additional end of week archives and an end of month archive for every month:
root@bpi-iot-jsho-borg-01:/# borg prune -v –list –keep-daily=7 –keep-weekly=4 –keep-monthly=-1 /borgbackup.data
# Keep all backups in the last 10 days 4 additional end of week archives and an end of month archive for every month:
root@bpi-iot-jsho-borg-01:/# borg prune -v –list –keep-within=10d –keep-weekly=4 –keep-monthly=-1 /borgbackup.data
# Script to keep all backups from the actual day the last backup for 14 days for 6 month and an end of year backup:
export BORG_PASSCOMMAND=“cat /root/.borg-passphrase“
borg create –compression lz4 –stats /borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
borg prune -v –list –keep-within 1d –keep-daily 14 –keep-monthly 6 –keep-yearly 1 /borgbackup.data
borg compact /borgbackup.data
borg list /borgbackup.data

How to use BorgBackup over your network – backup the local server to a remote machine

root@bpi-iot-jsho-borg-02:~# apt-get update -y
root@bpi-iot-jsho-borg-02:~# apt-get install borgbackup
root@bpi-iot-jsho-borg-02:~# borg –version
borg 1.2.0
root@bpi-iot-jsho-borg-02:~#
root@bpi-iot-jsho-borg-02:~# mkdir /borgbackup.data
root@bpi-iot-jsho-borg-01:~# borg init –encryption=repokey root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
Enter new passphrase: <password>
Enter same passphrase again: <password>
Do you want your passphrase to be displayed for verification? [yN]: n
By default repositories initialized with this version will produce security
errors if written to with an older version (up to and including Borg 1.0.8).
If you want to use these older versions, you can disable the check by running:
borg upgrade –disable-tam ssh://root@bpi-iot-jsho-borg-02/borgbackup.data
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
If you used a repokey mode, the key is stored in the repo, but you should back it up separately.
Use „borg key export“ to export the key, optionally in printable format.
Write down the passphrase. Store both at safe place(s).
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg create –stats root@bpi-iot-jsho-borg-02:/borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
root@bpi-iot-jsho-borg-02’s password: <password>
Enter passphrase for key ssh://root@bpi-iot-jsho-borg-02/borgbackup.data: <password>
——————————————————————————
Repository: ssh://root@bpi-iot-jsho-borg-02/borgbackup.data
Archive name: Backup-2022-04-04-19:31:49
Archive fingerprint: e93e47a73b6897fa445e9b126d3dbd454b747031fe715ea5b38ed9ae6c101401
Time (start): Mon, 2022-07-04 19:32:38
Time (end): Mon, 2022-07-04 19:40:55
Duration: 8 minutes 16.04 seconds
Number of files: 2445
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 1.28 GB
All archives: 2.10 GB 1.29 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2746 3049
——————————————————————————

root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg list root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
Enter passphrase for key ssh://root@bpi-iot-jsho-borg-02/borgbackup.data: <password>
Backup-2022-04-04-19:31:49 Mon, 2022-07-04 19:32:38 [e93e47a73b6897fa445e9b126d3dbd454b747031fe715ea5b38ed9ae6c101401]
Backup-2022-04-04-19:43:01 Mon, 2022-07-04 19:43:28 [ff2241e8d1f3c76270c65db089c5a65208f5447d25af970d9497a1b74ed97ede]

root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg delete root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
Enter passphrase for key ssh://root@bpi-iot-jsho-borg-02/borgbackup.data: <password>
You requested to completely DELETE the repository *including* 2 archives it contains.
Type ‚YES‘ if you understand this and want to continue: YES

root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg list root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
Repository root@bpi-iot-jsho-borg-02:/borgbackup.data does not exist.

root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg key export root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
BORG_KEY cd88b62118b7dd628427837630824131f3abc8af18811b73f560fcce89201cf4
hqlhbGdvcml0aG2mc2hhMjU2pGRhdGHaAN4R/IvMspOh12yx34fJmnhcdreyogreGkm7rG

1hZNNiUvWynIawLUXpjuDDQDux5u/I66G0cwpfxkqfSSy3Ebur+kaGFzaNoAICppAZEg+k
frGyAAK1IyrTx4jkX55wFohYd6xICrvuApqml0ZXJhdGlvbnPOAAGGoKRzYWx02gAg26Hb
cqxAJmjF56LVyAX9qz+U+oZYdoNY1FDWrBRjMTandmVyc2lvbgE=
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg init –encryption=keyfile root@bpi-iot-jsho-borg-02:/borgbackup.data
root@bpi-iot-jsho-borg-02’s password: <password>
Enter new passphrase: <password>
Enter same passphrase again: <password>
Do you want your passphrase to be displayed for verification? [yN]: n
By default repositories initialized with this version will produce security
errors if written to with an older version (up to and including Borg 1.0.8).
If you want to use these older versions, you can disable the check by running:
borg upgrade –disable-tam ssh://root@bpi-iot-jsho-borg-02/borgbackup.data
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
If you used a repokey mode, the key is stored in the repo, but you should back it up separately.
Use „borg key export“ to export the key, optionally in printable format.
Write down the passphrase. Store both at safe place(s).
root@bpi-iot-jsho-borg-01:~# ls -la
total 596
drwx—— 6 root root 4096 Jul 4 19:13 .
drwxr-xr-x 22 root root 4096 Jul 1 12:18 ..
-rw-r–r– 1 root root 957 Mar 31 11:11 –
-rw——- 1 root root 5556 Jul 4 20:00 .bash_history
-rw-r–r– 1 root root 3771 Jun 23 04:08 .bashrc
-rw-r—– 1 root root 522695 Jul 5 12:05 borgbackup.log
-rwxrwx— 1 root root 362 Jul 3 19:08 borgbackup.sh
-rw——- 1 root root 9 Jul 1 18:44 .borg-passphrase
drwx—— 4 root root 4096 Jul 1 12:19 .cache
drwx—— 8 root root 4096 Jul 1 12:44 .config
-rw-r–r– 1 root root 119 Jul 1 09:54 echo
-rw——- 1 root root 20 Jul 1 10:05 .lesshst
drwxr-xr-x 3 root root 4096 Jun 23 04:17 .oh-my-zsh
-rw-r–r– 1 root root 75 Jul 1 18:54 .selected_editor
drwx—— 2 root root 4096 Jul 4 19:13 .ssh
-rw——- 1 root root 10174 Jul 3 19:08 .viminfo
-rw-r–r– 1 root root 165 Jul 1 09:26 .wget-hsts
-rw-r–r– 1 root root 3948 Jun 23 04:17 .zshrc

root@bpi-iot-jsho-borg-01:~# cd .config

root@bpi-iot-jsho-borg-01:~/.config# ls -la
total 32
drwx—— 8 root root 4096 Jul 1 12:44 .
drwx—— 6 root root 4096 Jul 4 19:13 ..
drwxr-xr-x 2 root root 4096 Jun 23 04:15 autostart
drwx—— 4 root root 4096 Jul 5 13:02 borg
drwxr-xr-x 2 root root 4096 Jun 23 04:15 htop
drwx—— 2 root root 4096 Jul 1 12:44 procps
drwx—— 2 root root 4096 Jul 1 10:32 pulse
drwxr-xr-x 4 root root 4096 Jun 23 04:15 xfce4

root@bpi-iot-jsho-borg-01:~/.config# cd borg

root@bpi-iot-jsho-borg-01:~/.config/borg# ls -la
total 16
drwx—— 4 root root 4096 Jul 5 13:02 .
drwx—— 8 root root 4096 Jul 1 12:44 ..
drwx—— 2 root root 4096 Jul 5 13:02 keys
drwx—— 4 root root 4096 Jul 5 13:02 security

root@bpi-iot-jsho-borg-01:~/.config/borg# cd keys
root@bpi-iot-jsho-borg-01:~/.config/borg/keys# ls -la
total 12
drwx—— 2 root root 4096 Jul 5 13:02 .
drwx—— 4 root root 4096 Jul 5 13:02 ..
-rw——- 1 root root 553 Jul 5 13:02 bpi_iot_jsho_borg_02__borgbackup_data
root@bpi-iot-jsho-borg-01:~/.config/borg/keys#

How can I specify the encryption passphrase programmatically – using keyfile-based encryption with a blank passphrase so it is possible to encrypt your repository in keyfile mode instead of the default repokey mode and use a blank passphrase for the key file (simply press Enter twice when borg init asks for the password)

root@bpi-iot-jsho-borg-01:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <password>
Enter same passphrase again: <password>
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
root@bpi-iot-jsho-borg-01:~#

root@bpi-iot-jsho-borg-01:~# ssh-copy-id root@bpi-iot-jsho-borg-02
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: „/root/.ssh/id_rsa.pub“
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed — if you are prompted now it is to install the new keys
root@bpi-iot-jsho-borg-02’s password: <password>
Number of key(s) added: 1
Now try logging into the machine, with: „ssh ‚root@bpi-iot-jsho-borg-02′“ and check to make sure that only the key(s) you wanted were added.
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# ssh root@bpi-iot-jsho-borg-02 uname -a
Linux bpi-iot-jsho-borg-02 5.15.48-sunxi #22.05.3 SMP Wed Jun 22 07:35:10 UTC 2022 armv7l armv7l armv7l GNU/Linux
root@bpi-iot-jsho-borg-01:~#
root@bpi-iot-jsho-borg-01:~# borg create –stats root@bpi-iot-jsho-borg-02:/borgbackup.data::`date „+Backup-%Y-%d-%d-%H:%M:%S“` /resilio-sync.data
——————————————————————————
Repository: ssh://root@bpi-iot-jsho-borg-02/borgbackup.data
Archive name: Backup-2022-05-05-14:41:23
Archive fingerprint: eea83820e7c26e240ca62bd174c43e47b692ba540ae6ca13b8eee3a4b6dcc92c
Time (start): Tue, 2022-07-05 14:41:34
Time (end): Tue, 2022-07-05 14:41:43
Duration: 8.68 seconds
Number of files: 2447
Utilization of max. archive size: 0%
——————————————————————————
Original size Compressed size Deduplicated size
This archive: 2.10 GB 1.29 GB 678 B
All archives: 8.40 GB 5.16 GB 1.28 GB
Unique chunks Total chunks
Chunk index: 2762 12244
——————————————————————————
root@bpi-iot-jsho-borg-01:~#

Banana Pi BPI-M1 – how to install Resilio Sync 2.7.3 with an official linux package on Armbian Linux Jammy

Dienstag, Juni 28th, 2022

Resilio Sync – an official linux package is now available

root@bpi-iot-jsho-rslsync-01:~# apt-get update
root@bpi-iot-jsho-rslsync-01:~# vi /etc/apt/sources.list.d/resilio-sync.list
deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free
root@bpi-iot-jsho-rslsync-01:~# wget -qO – https://linux-packages.resilio.com/resilio-sync/key.asc | apt-key add –
root@bpi-iot-jsho-rslsync-01:~# apt-get update
root@bpi-iot-jsho-rslsync-01:~# apt-get install resilio-sync
root@bpi-iot-jsho-rslsync-01:~# systemctl status resilio-sync
● resilio-sync.service – Resilio Sync service
Loaded: loaded (/lib/systemd/system/resilio-sync.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-06-28 17:01:40 CEST; 8min ago
Docs: https://help.resilio.com
Process: 4151 ExecStartPre=/bin/mkdir -p ${SYNC_RUN_DIR} ${SYNC_LIB_DIR} (code=exited, status=0/SUCCESS)
Process: 4152 ExecStartPre=/bin/chown -R ${SYNC_USER}:${SYNC_GROUP} ${SYNC_RUN_DIR} ${SYNC_LIB_DIR} (code=exited, status=>
Process: 4153 ExecStart=/usr/bin/rslsync –config ${SYNC_CONF_DIR}/config.json (code=exited, status=0/SUCCESS)
Process: 4155 ExecStartPost=/bin/sleep 1 (code=exited, status=0/SUCCESS)
Main PID: 4154 (rslsync)
Tasks: 18 (limit: 2059)
Memory: 489.1M
CPU: 7min 18.635s
CGroup: /system.slice/resilio-sync.service
└─4154 /usr/bin/rslsync –config /etc/resilio-sync/config.json
Jun 28 17:01:39 bpi-iot-jsho-rslsync-01 systemd[1]: Starting Resilio Sync service…
Jun 28 17:01:40 bpi-iot-jsho-rslsync-01 systemd[1]: Started Resilio Sync service.

root@bpi-iot-jsho-rslsync-01:~#
root@bpi-iot-jsho-rslsync-01:/# cd /
root@bpi-iot-jsho-rslsync-01:/# mkdir resilio-sync.data
root@bpi-iot-jsho-rslsync-01:/# chown rslsync resilio-sync.data
root@bpi-iot-jsho-rslsync-01:/# chgrp rslsync resilio-sync.data
root@bpi-iot-jsho-rslsync-01:~# cd /etc/resilio-sync
root@bpi-iot-jsho-rslsync-01:/etc/resilio-sync# vi config.json
{

„storage_path“ : „/var/lib/resilio-sync/“,
„pid_file“ : „/var/run/resilio-sync/sync.pid“,
„webui“ :
{
„force_https“: true,
„listen“ : „0.0.0.0:8888“
}
}
root@bpi-iot-jsho-rslsync-01:~# systemctl enable resilio-sync
root@bpi-iot-jsho-rslsync-01:~# systemctl restart resilio-sync

Banana Pi BPI-M1 – how to update an S3-compatible object storage server with MinIO on Armbian Bullseye

Dienstag, April 12th, 2022
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2021-11-24T23:19:33Z to 2022-04-12T06-55-35Z
root@rpi-iot-jsho-cam-02:~#

Banana Pi BPI-M1 – expand root system to use all of SD card on Armbian Bullseye

Sonntag, April 10th, 2022
root@bpi-iot-jsho-minio-01:~# df -k
Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
udev 452940 0 452940 0% /dev
tmpfs 101488 704 100784 1% /run
/dev/mmcblk0p1 30167436 1474852 28354100 5% /
tmpfs 507436 0 507436 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 507436 0 507436 0% /tmp
/dev/zram1 49560 21564 24412 47% /var/log
tmpfs 101484 0 101484 0% /run/user/0
root@bpi-iot-jsho-minio-01:~# /usr/lib/armbian/armbian-resize-filesystem start
root@bpi-iot-jsho-minio-01:~#
root@bpi-iot-jsho-minio-01:~# df -k
Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
udev 452940 0 452940 0% /dev
tmpfs 101488 704 100784 1% /run
/dev/mmcblk0p1 118347496 1475900 115633496 2% /
tmpfs 507436 0 507436 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 507436 0 507436 0% /tmp
/dev/zram1 49560 21584 24392 47% /var/log
tmpfs 101484 0 101484 0% /run/user/0
root@bpi-iot-jsho-minio-01:~#

Banana Pi BPI-M1 – how to update an S3-compatible object storage server with MinIO on Armbian Bullseye

Sonntag, April 3rd, 2022
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2022-03-26T06:49:28Z to 2022-04-01T03-41-39Z

root@rpi-iot-jsho-cam-02:~#

Banana Pi BPI-M1 – how to update an S3-compatible object storage server with MinIO on Armbian Bullseye

Montag, März 14th, 2022
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2022-02-18T01:50:10Z to 2022-02-24T22 -12-01Z
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# wget https://dl.minio.io/client/mc/release/linux-arm/mc
–2022-02-26 09:43:49– https://dl.minio.io/client/mc/release/linux-arm/mc
Resolving dl.minio.io (dl.minio.io)… 138.68.11.125, 178.128.69.202
Connecting to dl.minio.io (dl.minio.io)|138.68.11.125|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 20381696 (19M) [application/octet-stream]
Saving to: ‘mc’
mc 100%[================================================================================>] 19.44M 5.28MB/s in 4.0s
2022-02-26 09:43:54 (4.84 MB/s) – ‘mc’ saved [20381696/20381696]
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# chmod +x ./mc
root@rpi-iot-jsho-cam-02:~# 

root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2022-02-26T02:54:46Z to 2022-03-05T06 -32-39Z
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2022-03-05T06:32:39Z to 2022-03-11T23-57-45Z
root@rpi-iot-jsho-cam-02:~#

Banana Pi BPI-M1 – object locking with an S3-compatible object storage server MinIO on Armbian Bullseye

Dienstag, Februar 22nd, 2022

Banana Pi BPI-M1 – how to update an S3-compatible object storage server with MinIO on Armbian Bullseye

Sonntag, Februar 20th, 2022
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2021-12-20T22:07:16Z to 2022-02-18T01-50-10Z
root@rpi-iot-jsho-cam-02:~#

Banana Pi BPI-M1 – how to update an S3-compatible object storage server with MinIO on Armbian Bullseye

Sonntag, Februar 13th, 2022
root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2022-02-07T08:17:33Z to 2022-02-12T00-51-25Z
root@rpi-iot-jsho-cam-02:~#

Banana Pi BPI-M1 – how to install NextCloudPi with NextCloud 21.0.4

Mittwoch, Februar 2nd, 2022

NextCloudPi – is a Nextcloud instance that is preinstalled and preconfigured and includes a management interface with all the tools you need to self host your private data in a single package

Banana Pi BPI-M1 – expand root system to use all of SD card on Armbian Bullseye

Sonntag, Januar 30th, 2022


# systemctl enable armbian-resize-filesystem
# reboot

Banana Pi BPI-M1 – practical example with an S3-compatible object storage server with MinIO on Armbian Bullseye

Montag, Januar 24th, 2022

root@rpi-iot-jsho-cam-02:~# vi MinioMotioneyeBackup.sh
#!/bin/bash
#FileName: MinIoMotioneyeBackup.sh
LocalBackupPath=“/var/lib/motioneye“
MinioBucket=“myminio/worm-with-versioning-and-retention/motioneye“
MCPATH=“/root/mc“
$MCPATH mirror –json –overwrite –remove –preserve $LocalBackupPath $MinioBucket
$MCPATH rm –force –versions –recursive –older-than 7d $MinioBucket
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# vi MinioMotioneyeBackup2.sh
!/bin/bash
#FileName: MinIoMotioneyeBackup2.sh
LocalBackupPath=“/var/lib/motioneye“
MinioBucket=“myminio/noworm-with-versioning-and-noretention/motioneye“
MCPATH=“/root/mc“
$MCPATH mirror –json –overwrite –remove –preserve $LocalBackupPath $MinioBucket
$MCPATH rm –force –versions –recursive –older-than 7d $MinioBucket
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# vi MinioMotioneyeBackup3.sh
!/bin/bash
#FileName: MinIoMotioneyeBackup3.sh
LocalBackupPath=“/var/lib/motioneye“
MinioBucket=“myminio/noworm-with-noversioning-and-noretention/motioneye“
MCPATH=“/root/mc“
$MCPATH mirror –json –overwrite –remove –preserve $LocalBackupPath $MinioBucket
root@rpi-iot-jsho-cam-02:~#
root@rpi-iot-jsho-cam-02:~# vi MinioMotioneyeBackupStart.sh
#! /bin/bash
/root/MinioMotioneyeBackup.sh
/root/MinioMotioneyeBackup2.sh
/root/MinioMotioneyeBackup3.sh
root@rpi-iot-jsho-cam-02:~# crontab -l
15 * * * * /root/MinioMotioneyeBackupStart.sh >> /dev/null 2>&1
root@rpi-iot-jsho-cam-02:~#

… after one week backup

root@rpi-iot-jsho-cam-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2021-12-29T06:49:06Z to 2022-01-08T03-11-54Z

… after two weeks

Banana Pi BPI-M1 – Let’s Encrypt SSL how to use a private key and public certificate with an S3-compatible object storage server with MinIO on Armbian Bullseye

Donnerstag, Dezember 30th, 2021

root@bpi-iot-jsho-minio-03:~# apt-get install certbot
root@bpi-iot-jsho-minio-03:~# certbot certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate number [1-2] then [enter] (press ‚c‘ to cancel): 1
Plugins selected: Authenticator standalone, Installer None
Please enter in your domain name(s) (comma and/or space separated) (Enter ‚c‘
to cancel): bpi-iot-jsho-minio-03.ddnss.eu
Requesting a certificate for bpi-iot-jsho-minio-03.ddnss.eu
Performing the following challenges:
http-01 challenge for bpi-iot-jsho-minio-03.ddnss.eu
Waiting for verification…
Cleaning up challenges
Subscribe to the EFF mailing list (email: josef.schuster@dpsolution.de).
IMPORTANT NOTES:
– Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/bpi-iot-jsho-minio-03.ddnss.eu/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/bpi-iot-jsho-minio-03.ddnss.eu/privkey.pem
Your certificate will expire on 2022-03-27. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew *all* of your
certificates, run „certbot renew“
– If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
root@bpi-iot-jsho-minio-03:~#
root@bpi-iot-jsho-minio-03:/# find . -name fullchain.pem -print
./etc/letsencrypt/live/bpi-iot-jsho-minio-03.ddnss.eu/fullchain.pem
root@bpi-iot-jsho-minio-03:/#
root@bpi-iot-jsho-minio-03:~# cp /etc/letsencrypt/live/bpi-iot-jsho-minio-03.ddnss.eu/fullchain.pem $HOME/.minio/certs/public.crt
root@bpi-iot-jsho-minio-03:~# cp /etc/letsencrypt/live/bpi-iot-jsho-minio-03.ddnss.eu/privkey.pem $HOME/.minio/certs/private.key

If your TLS certificates do not have the IP SAN for the MinIO server host the MinIO Console may fail to validate the connection to the server use the MINIO_SERVER_URL environment variable and specify the proxy-accessible hostname of the MinIO server to allow the Console to use the MinIO server API using the TLS certificate

root@bpi-iot-jsho-minio-03:/# MINIO_SERVER_URL=“https://bpi-iot-jsho-minio-03.ddnss.eu:9000″ MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=<password> ./minio server –console-address „:9001“ /data/data{0…3}
https://bpi-iot-jsho-minio-03.ddnss.eu:9001

root@bpi-iot-jsho-minio-02:~# ./mc alias set myminio https://bpi-iot-jsho-minio-03.ddnss.eu:9000 admin <password>
Added `myminio` successfully.
root@bpi-iot-jsho-minio-02:~#
root@bpi-iot-jsho-minio-02:~# ./mc –version myminio
mc version RELEASE.2021-12-20T23-43-34Z
root@bpi-iot-jsho-minio-02:~# ./mc admin update myminio
Server `myminio` updated successfully from 2021-12-20T22:07:16Z to 2021-12-29T06-49-06Z
root@bpi-iot-jsho-minio-02:~#