I suspected that there might be a cron/anacron job somewhere. I found it here:
/etc/cron.d/openmediavault-rsync
It contains
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
13 8 * * * root /var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a >/dev/null 2>&1
So I checked
/var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a
it contains
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
13 8 * * * root /var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a >/dev/null 2>&1
So I checked
/var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a
it contains
#!/bin/sh
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
. /usr/share/openmediavault/scripts/helper-functions
cleanup() {
omv_kill_children $$
rm -f /var/run/rsync-fcc54383-1496-4715-8ca7-d1e17016770a
exit
}
[ -e /var/run/rsync-fcc54383-1496-4715-8ca7-d1e17016770a ] && exit 1
if ! omv_is_mounted "/srv/dev-disk-by-label-BK01" ; then
omv_error "Destination storage device not mounted at </srv/dev-disk-by-label-BK01>!"
exit 1
fi
trap cleanup 0 1 2 5 15
touch /var/run/rsync-fcc54383-1496-4715-8ca7-d1e17016770a
omv_log "Please wait, syncing <root@libreelec:/var/media/INTENSO/Fotos> to </srv/dev-disk-by-label-BK01/Backup/libreelec> ...\n"
export RSYNC_PASSWORD="le"
rsync --verbose --log-file="/var/log/rsync.log" --recursive --times --archive --perms --rsync-path=/storage/.kodi/addons/virtual.network-tools/bin/rsync 'root@libreelec:/var/media/INTENSO/Fotos' '/srv/dev-disk-by-label-BK01/Backup/libreelec' & wait $!
omv_log "\nThe synchronisation has completed successfully."
Alles anzeigen
So I executed this rsync command (line 30) in bash:
root@ser03:/# rsync --verbose --log-file="/var/log/rsync.log" --recursive --times --archive --perms --rsync-path=/storage/.kodi/addons/virtual.network-tools/bin/rsync 'root@libreelec:/var/media/INTENSO/Fotos' '/srv/dev-disk-by-label-BK01/Backup/libreelec'
root@libreelec's password: <<<<<<!!!!
receiving incremental file list
Fotos/
Fotos/Rxxx/
Fotos/Rxxx/BILD_20190510_124331.jpg
Fotos/Rxxx/BILD_20190510_124351.jpg
Fotos/Rxxx/BILD_20190510_181340.jpg
Fotos/Rxxx/BILD_20190511_154252.jpg
[...]
Fotos/Rxxx/IMG_20190515_143229.jpg
Fotos/Rxxx/IMG_20190515_215323.jpg
Fotos/Rxxx/.stfolder/
sent 1,067 bytes received 128,134,513 bytes 7,765,792.73 bytes/sec
total size is 509,458,608 speedup is 3.98
Alles anzeigen
the rsync command works (here with password (line 2)).
My thesis:
rsync may fail due to login issue on libreelec.
So I configured passwordless login:
(public key already exists already on OMV, so I just copied public key to remote device "libreelec"):
# ssh-copy-id -i ~/.ssh/id_rsa.pub libreelec
/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@libreelec's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'libreelec'"
and check to make sure that only the key(s) you wanted were added.
Alles anzeigen
and it works with ssh:
root@ser03:/# ssh libreelec
##############################################
# LibreELEC #
# http://libreelec.tv #
##############################################
LibreELEC (wrxtasy-raybuntu-media_build) Version: 8.0
Alles anzeigen
Now the rsync command works in bash without PW:
root@ser03:/# rsync --verbose --log-file="/var/log/rsync.log" --recursive --times --archive --perms --rsync-path=/storage/.kodi/addons/virtual.network-tools/bin/rsync 'root@libreelec:/var/media/INTENSO/Fotos' '/srv/dev-disk-by-label-BK01/Backup/libreelec'
receiving incremental file list
Fotos/Rxxx/
Fotos/Rxxx/BILD_20190524_073950.jpg
sent 55 bytes received 3,488,304 bytes 2,325,572.67 bytes/sec
total size is 512,942,451 speedup is 147.04
Alles anzeigen
Final test: what if I execute the rsync job in OMV web gui (did not change the settings):
Please wait, syncing <root@libreelec:/var/media/INTENSO/Fotos> to </srv/dev-disk-by-label-BK01/Backup/libreelec> ...
receiving incremental file list
Fotos/Rxxx/
Fotos/Rxxx/BILD_20190524_074912.jpg
sent 55 bytes received 4,798,082 bytes 3,198,758.00 bytes/sec
total size is 517,735,734 speedup is 107.90
The synchronisation has completed successfully.
Fertig ...
Alles anzeigen
Conclusion:
rsync works in my case only with public key authentication even the rsync job is set up with password authentication.