Skip to content

This is a guide on how to backup and restore any Termux distro without losing folders and files permissions

Notifications You must be signed in to change notification settings

postkevone/backupdistrotermux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

This is a guide on how to backup and restore any Termux distro without losing folders and files permissions


Youtube Tutorial

youtube tutorial


Backup

  • Make sure your distro root folders (es. /dev, /proc) can be read by the owner
  • If not, change the permissions of the folders to (400)
  • Use the following command to backup your Termux "home" and "usr" folder

(you can change your preferred destination for the backup instead of the sdcard root)

cd /data/data/com.termux/files
tar --format=gnu -pzcf /sdcard/termux-backup.tar.gz home usr

Restore

  • Make sure to have storage permissions and the latest version of your Termux packages (supposing you have just installed Termux)
termux-setup-storage
pkg update && pkg upgrade
  • Restore the "home" folder with the following commands:
cd /data/data/com.termux/files
rm -rf home
tar --same-owner -pzxf /sdcard/termux-backup.tar.gz home
  • Then restore the "usr" folder as well
cd /data/data/com.termux/files
cp ./usr/bin/busybox ./tar
rm -rf usr
unset LD_PRELOAD
./tar -zxf /sdcard/termux-backup.tar.gz usr
exit
  • You did it! You successfully restored your Termux distro!

About

This is a guide on how to backup and restore any Termux distro without losing folders and files permissions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published