We ran into a situation where attempting to do an image backup of a Debian 10 server with dattobd version 0.10.15 and URBackup 2.2.26 failed. It presents similar to the description in this forum post:
We found in this case that the dattobd kernel driver was not creating /dev/dattoX files and therefore the script was failing at the same point as in the post above:
while [ -e "/dev/datto$NUM" ] && has_num $NUM
do
NUM=`expr $NUM + 1`
done
There is, however, a JSON formatted file present (/proc/datto-info) that shows all the configured datto devices. Therefore I wrote this modification:
- In the ‘scripts’ subdirectory, a file named ‘find_dattobd_minor.py’
#!/usr/bin/python3
import json
info = json.load(open('/proc/datto-info','r'))
devices = info['devices']
minor_list = []
for item in devices:
minor_list.append(item['minor'])
print(*minor_list)
- A modification to the ‘dattobd_create_snapshot’ shell script. First is to change the script from #!/bin/sh to #!/bin/bash and second is this modification that replaces line 58-61:
DATTO_INDEX=(`/usr/local/share/urbackup/scripts/find_dattobd_minor.py`)
NUM=0
#while [ -e "/dev/datto$NUM" ] && has_num $NUM
while [[ "${DATTO_INDEX[*]}" =~ "${NUM}" ]] && has_num $NUM
do
NUM=`expr $NUM + 1`
done
Possibly this can be incorporated into a release where the script tests for the presence of a /dev/dattoX directory and if not present but a /proc/datto-info file exists it uses this method. That way both varieties are covered.
Thanks,
Eric Kreckel
CTO Westelcom