very long story happend to me today would take days to be written to sync my massive media dir to be 1:1 with my android phone usually I used jmtpfs it’s good but I had to mess with udev rules for kernel usb autosuspend (not configured on archlinux by default) and more headaches until I came to
- rsync
- sshfs
- sshd (termux)
I would simply move and delete files around after while sync them to my android phone over network for destination to be 1:1 as my source directory
on my phone with termux :
# if openssh not install
# pkg install openssh
# set a user password with passwd
passwd
sshd
#default port is 8022 not 22 because Android's security rules block normal apps from using any port number below 1024
from my archlinux pc :
# now i mount my phone using sshfs over sftp
sshfs [email protected]:/sdcard/ phone/ -p 8022
# and simply rsync my media direction
rsync -av --size-only --partial --delete /mnt/base/mcore/ phone/mcore/
that’s saved much of my time around 3000 files get removed added automatically
with the help of rsync
also special thanks for @hydn for his amazing blog about rsync it helped me understanding it better