I have an android device that has no free space and no sd-card that I can replace (thanks to oneplus policy). I also have no free space on PC to accomodate the backup so I wanted to upload it to the cloud. I have ssh and root access to the device. I also have a remote ftp server space (that I not trust, tough).

I would like to make a password protected tar or zip file and upload it there. I'm not sure if a zip of / is sufficient for backup purposes.

The problem is there is no free space left on the device so I need to create the zip file on the fly and "stream" it to the backup server (it's sftp on port 30).

I checked that the ssh, rsync and zip commands are available but I'm not sure how to do a full backup, encrypted zip compression and sftp upload without writing to the disk.

How can I combine commands to do that while connected to the device over ssh?

  • I feel this lack of space everywhere may be a common situation... – beppe9000 Nov 19 at 12:31
  • Use rclone, far better than FTP and far easy to handle than SFTP. It has built-in encryption. On Android backing up from rootfs / doesn't make sense. Just backup targeted directories depending on what you want to backup. – Irfan Latif Nov 19 at 14:59
  • usually backup of /data is enough, but make sure to preserve selinux context too (besides uid/gid and permissions) – alecxs Nov 19 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.