Home / Community / Blog

After you manage to ssh to your android device. You can set it up to backup with BackupPC.

Since rsync command is not available You can use tar. In configuration you have to set:

$Conf{XferMethod} = 'tar';

change path to tar:

$Conf{TarClientPath} = 'tar';

and command to execute:

$Conf{TarClientCmd} = '$sshPath -q -x -n -p 2222 $host env LC_ALL=C $tarPath -c -v -f - -C $shareName+';

as you can see I've removed -l root and --totals.

Complete config is:

$Conf{XferMethod} = 'tar';
$Conf{TarClientPath} = 'tar';
$Conf{TarShareName} = [
  '/storage/emulated/0/DCIM/Camera/'
];
$Conf{TarClientCmd} = '$sshPath -q -x -n -p 2222 $host env LC_ALL=C $tarPath -c -v -f - -C $shareName+';

There are still some problems because backup is ended with an error:

Running: /usr/bin/ssh -q -x -n -p 2222 huawei_p10 env LC_ALL=C tar -c -v -f - -C /storage/emulated/0/DCIM/Camera .
full backup started for directory /storage/emulated/0/DCIM/Camera
Xfer PIDs are now 19406,19405
(...)
tarExtract: Done: 0 errors, 0 filesExist, 0 sizeExist, 0 sizeExistComp, 78 filesTotal, 227795841 sizeTotal
Backup aborted ()
Not saving this as a partial backup since it has fewer files than the prior one (got 78 and 0 files versus 1814)

You can backup android phone/tabled (device) with rsync installed on some host and SimpleSSHD installed on device.

First you have to check if you can ssh to device:

To login first time You have to run SimpleSSHD and press START to run it in foreground. From some host login to device using command:

sudo -u backuppc /usr/bin/ssh 192.168.1.241 -p 2222

enter password displayed in SimpleSSHD windows on device, you will see something like this:

no authorized_keys, generating single-use password
--------
yrGAex8s
--------

As you can see my device has address 192.168.1.241 and server is using his default port 2222. You don't have to provide any user name (ie. -l someuser).

Now you can backup device manually using rsync:

rsync --update -e 'ssh -p 2222' -azv \
192.168.1.241:/storage/emulated/0/DCIM/Camera/ /data/myPhoneBackup/

Another approach is to use Rsync Wrapper by Letscorp (I didn't tested it yet).

The main target is to make android device be able to backup using BackupPC.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31