Assalamualaikum. Meet me again, this time I will discuss about how to backup and restore termux. Previously I have discussed the meaning of termux, its functions and tutorials on how to install termux. Below I will include a post link for those who do not understand it. So check out the reviews below.
After a long time you learn termux and work with TERMUX on android like installing, testing, setting up various applications on termux. Of course you don't want all your hard work to be lost instantly caused by a glitch/error in the Termux application or damage to your Android smartphone.
Why do you have to Backup TERMUX?
To overcome and prevent this bad thing from happening, Termux has provided a restic application/package that you can install and use to back up or restore the backup results.
TIPS
It's a good idea to put / save the backup file in external storage such as SDCARD or OTG FLashdisk,
the problem is that if you backup on the internal memory and your cellphone is damaged, how do you get the backup file, try it.
FIX storage permission denied TERMUX
When learning termux for the first time, you will definitely encounter the error "storage permission denied" because termux does not have permission to access storage (internal and external storage).
To solve this, make sure your termux has been given permission to access SDCARD/storage.
If you haven't run the $ termux-setup-storage command, select allow if a popup dialogue appears.
Or you can go to the settings menu on your android > applications/apps > termux > permissions > slides/check the storage.
1. How to Backup TERMUX
To be able to back up termux easily and safely, you should use the restic application, if not you can install it first with the $ pkg install restic command.
Create a directory to save the backup results on the sdcard with the command $ mkdir -p /sdcard/termux-backups.
Make the local directory that you have created a local repository with the command $restic init -r /sdcard/termux-backups .
In this process you will be asked to create a password (after making it don't forget or your backup results cannot be used).
Start the backup process by typing the command $ restic backup -r /sdcard/termux-backups --tag termux $PREFIX.
restic applies a single incremental backup method, so even if you back up many times the result is only 1 backup file with changes in size according to the number of packages in your termux.
So you don't have to worry about the storage being full because you often back up.
To do a backup again just type the command $ restic backup -r /sdcard/termux-backups --tag termux $PREFIX.
2. How to Restore TERMUX
How to restore termux follows assuming the backup file is in "/sdcard/termux-backups" if the backup location is different you can adjust it in the command you will run.
First, make sure you have installed the restic application, if you haven't already installed it by running the command $ pkg install unstable-repo then $ pkg install restic.
The process of restoring termux is a bit more complicated than the backup method of termux, because we will delete the existing environment and replace it with a backup environment.
Copy the restic application to $HOME, so that restic can be run directly from the current working directory location (by default in $HOME) by typing the command $ cp $PREFIX/bin/restic $HOME/restic and to make sure you are at home run the command $ cd ~
Unset LD_PRELOAD (disable termux-exec) with $ unset LD_PRELOAD command
Remove old $PREFIX with command $ rm -rf $PREFIX
Restore termux from the termux-backups folder with the command $ $HOME/restic restore -r /sdcard/termux-backups --tag termux --target / latest
If everything is done correctly you should have managed to restore termux from the backup file, just close the termux application then run it again and enjoy continuing to learn it.
CONCLUSION
Termux is just an application that is used to access the linux shell on your android, termux is not only used as a hacking tool, more than that termux can be used for other purposes according to the expertise of the user's computer.
End from me about the discussion about termux, hopefully this is useful and thank you.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good post dear friend keep it up bro and keep learn with our steem fellows and friends.
Regards, Faran Nabeel
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit