Rsync to Android

Connecting Android to your Linux you need to use gvfs. Rsync also wants to set files timestams that is why you need this hack.

 

0. Install gvfs-fuse

For use MTP devices in terminal need to use gvfs-use:

apt install gvfs-fuse

and reboot.

 

1. Find MTP device in /run/user/1000/gvfs

ls /run/user/1000/gvfs
'mtp:host=Samsung_A7_caf675d6'

Next follow to that folder you need to store your data.

 

2. Use rsync flags --verbose --progress --omit-dir-times --no-perms --recursive --inplace

To permit rsync trying to modify file timestamps add --omit-dir times, otherwise you can get errors like:

rsync: [receiver] mkstemp "/run/user/1000/gvfs/mtp:host=Samsung_A7_caf675d6/Internal shared storage/my/music/ringtone.mp3.wp8Y8M" failed: Operation not supported (95)

 

rsync --verbose --progress --omit-dir-times --no-perms --recursive --inplace  /home/user/music "/run/user/1000/gvfs/mtp:host=Samsung_A7_caf675d6/Internal shared storage/my/"

 

Than should work.

 

Links

[1] How to rsync to android https://askubuntu.com/questions/343502/how-to-rsync-to-android

Section
Category