11.08.2019

Backup Files From Android Using Rsync Over Wifi

  1. Root your phone if you need to access files that are not on the internal SD-Card
  2. Get SSHelper e.g. from Google Play
  3. Install cygwin and rsync
  4. Profit:
					
					rsync -avzzPW -e 'ssh -p2222' --rsync-path="su -c rsync" Eric@192.168.0.192:/storage/0000-0000/Android/data/com.something/files files
				

The command explained:

  • rsync performs syncing
  • -a tells rsync to use several convenient settings for archiving. See the rsync man page. It retains timestamps for example.
  • -v tells rsync to be verbose.
  • -zz tells rsync to compress the data before sending it. This is useful because we use SSHelper with WiFi instead of a fast, reliable, direct connection. Actually, -z would do that. Run it first with -z and if it tells you to use old-style with -zz, then use that.
  • -P tells rsync to show the progress
  • -W tells rsync to only copy whole files, not work with file deltas. This helps if the command hangs on a file.
  • -e 'ssh -p2222' tells rsync the port on which SShelper is listening.
  • --rsync-path="su -c rsync" is only necessary if you want to access something as root
  • username@IP can be any username if SSHelper is fine with it, and the IP SSHelper tells you is the Server Address.
  • :/storage/some/path tells rsync to load the directory at that remote path.
  • files is the destination on your PC.