On your Xiaomi, download KDE Connect. Your phone will now appear in your file manager (Dolphin, Nautilus, etc.) automatically.
Save as mi-backup.sh :