lbu: support backups of multiple hosts on one device
I have two computers running apline and would like to use the same usb stick to save their lbu backup files. But lbu complains when there are two apkovl files present:
two:/mnt# lbu ci
The following apkovl file(s) were found:
/media/usb/one.apkovl.tar.gz
/media/usb/two.apkovl.tar.gz
Please use -d to replace.
I understand that apkovl is the active file, since backup_apkovl() in lbu replaces "apkovl" with the date.
But I think the functionality could easily be enabled if lbu would only consider files starting with the hostname, which is true almost everywhere except in these 3 occasions in function cmd_commit():
line 453: local rmfiles=$(ls "$mnt/"*.apkovl.tar.gz* 2>/dev/null)
line 460: [ -z "$DRYRUN" ] && rm "$mnt/"*.apkovl.tar.gz*
line 463: lines=$(ls -1 "$mnt"/*.apkovl.tar.gz* 2>/dev/null)
I changed these locally to ${hostname}.*.apkovl.tar.gz
and that works as expected.
What I don't know is: Is this by design? Should there ever only be one apkovl file on any given device?