Reputation: 991
I want to transfer abc.txt file from android client to server via rsync. Unfortunately, I did not find any documentation for the same in android developer site. Is there a way to transfer data from the client using rsync in a non-rooted device.
What is the best practice to transfer say 100 MB of data from a client to server? We can always use the Database and make chunk upload out of that. Is there a best practice that is followed apart from Database division and sync design.
Upvotes: 2
Views: 6790
Reputation: 426
Do you want a way to achieve this with a script or run it manually from your device ?
Manually, you can do it. The easiest and most reliable is certainly to use rsync - and it works for Linux, MacOS and Windows. And it's also a great way to backup your device :-)
Here are a few simple steps to get there:
$ pkg install rsync
$ rsync -av /sdcard/[your-file] [server-ip]:/[destination]
You can the even use it to copy files to your computer with rsync via USB (these are Linux commands, but it should work on any other OS as well).
$ passwd
$ sshd
$ adb forward tcp:8022 tcp:8022
$ rsync -av -e 'ssh -p 8022' localhost:/sdcard/[whatever-file] /[destination]
Upvotes: 9