Sync Photos or Files over wifi Between Android and Linux with rsync and curlftpfs

I’ve had mixed success with transferring files between by Android phone and my Linux computer. I’ve come to prefer using rsync for any file transfer; I grant that copying will often work, but the ease of double-checking that the transfer happened as planned, or of restarting it in the event of a failed transfer is worth a tiny bit of command line work for me. I’m assuming that you know how to install packages and know how to get a terminal.

Install an ftp server on your phone. I use File Manager HD. In File Manager HD, tap on ‘Tools’ at the top. Under File Transfer, click on ‘Transfer to PC.,’ than click ‘Start.’

Install rsync and curlftpfs on your computer.

Create a directory (“Phone” in this example; remember that Linux commands are case-sensitive.) on your computer and mount the phone storage there (Enter the IP address of your phone, displayed in File Manager HD.):

mkdir Phone
curlftpfs ftp://192.168.20.191:2121/ Phone/

Browse and drill down to your desired folder using cd, ls, etc. Don’t forget to tab for auto-complete and double-tab to see what your options are.

cd Phone
ls
(etc.)

Use rsync to perform the sync. I use the -av options. See rsync manpage to help you. If you’re not familiar with rsync, make sure you understand the implications of omitting a trailing forward slash:

rsync -av /Phone/storage_0000-0000/DCIM/Camera/ ~/Pictures/2017-10-12/

After the transfer is finished, here’s the fun: up-arrow reruns the sync, and you can confirm with confidence the success of the transfer. There’s something strangely gratifying about seeing a ridiculously high speed-up (meaning the amount of time you saved over a straight re-copy):

sent 3,311 bytes received 12 bytes 2,215.33 bytes/sec
total size is 3,904,488,112 speedup is 1,174,988.90

Make sure to unmount the ftp directory before you quit:

fusermount -u Phone/

Done!

Advertisements

About anisly

This is Yet Another Tech Blog--my attempt at propagating some of what I've gleaned in trying to solve tech problems. YMMV, but enjoy
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Sync Photos or Files over wifi Between Android and Linux with rsync and curlftpfs

  1. Amazing! But you’ve some error: one f missed in “curlftps ftp://192.168.20.191:2121/ Phone/”
    I tried some other FTP-Server, found Wifi FTP Server, fewer ads. Thanks a lot.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s