Skip to content

daliujs/rsync-mobile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rsync-<arch>

使用 Android NDK 为不同的移动架构构建 rsync 可执行文件

Clone

  $ git clone https://github.com/daliujs/rsync-mobile
  $ git submodule update --init --recursive

一次搞定的命令:

  $ git clone --recurse-submodules https://github.com/daliujs/rsync-mobile

Build

  // for build rsync-<arch>
  $ ./ndk_build.sh
  // for test bin files
  $ ./test.sh

Android rsync-<arch> 文件

  1. 需要放到 /system/bin 目录下
  $ adb root
  $ adb push rsync-<arch> /system/bin
  1. 修改owner & group 及执行权限 (注,如果需要的话)
  $ adb shell
  $ chown root:shell /system/bin/rsync-<arch>
  $ chmod a+x /system/bin/rsync-<arch>
  1. 修改文件属性
$ chmod 755 /system/bin/rsync-<arch>

Android rsync-<arch> daemon 服务端

  1. Rsync Daemon配置文件
$ cat rsyncd.conf

address = 0.0.0.0
port = 873
uid = 1000
gid = 1000
strict modes = false
use chroot = false
auth users = wanba
secrets file = /<path-to>/rsync.pass
lock file = /<path-to>/rsync.lock 
log file = /<path-to>/rsyncd.log

[sdcard_android_data]
path = /sdcard/Android/data/
comment = SD Android Data
list = true
read only = false
#write only = true

[sdcard_apks]
path = /sdcard/Apks/
comment = SD Apks
list = true
read only = false
#write only = true
  1. secrets 文件
$ cat rsync.pass

wanba:123456
  1. 需要把client端ip以及名称写入 /etc/hosts
$ cat /etc/hosts

127.0.0.1		    localhost
10.1.7.180		  bogon
  1. 启动 Rsync Daemon 服务
$ rsync-<arch>  --daemon --verbose --config=/<path-to>/rsyncd.conf

Android rsync-<arch> 客户端

  1. Password 文件
$ cat password 
123456
  1. 客户端 upload 文件到 服务端
$ rsync-<arch> -rv --password-file=password ./* rsync://wanba@<server-ip>/sdcard_android_data
$ rsync-<arch> -rv --password-file=password ./* wanba@10.1.3.86::sdcard_apks

About

使用 Android NDK 为不同的移动架构构建 rsync 可执行文件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages