An automated android backup system design to synchronize your termux files with google drive. This project contains five primary scripts:
backup.sh
: performs the actual backup of fhe file using rclone.auto_backup.sh
: sets up an automated backup schedule using cron jobs.auto_disable.sh
: disables the automated backup by removing cron jobs and startup scripts.setup_gdrive.sh
: configures rclone to work with Google Drive.install.sh
: Installs necessary packages if they are not already installed.
Termux App
- download Termux here.
Google Account
- see Google Drive Setup here.
- Install git.
pkg install git -y
- clone the repository.
git clone https://github.com/christiangarcia0311/termux-gdrive-backup
- configure project directory.
cd termux-gdrive-backup
- install required packages.
sh install.sh
- configure gdrive as a remote.
sh setup_gdrive.sh
see Google Drive Setup for guide.
- edit backup script.
open backup.sh
and replace <foldername_existed>
with the name of the folder you want to back up in termux.
LOCAL_DIRECTORY="/data/data/com.termux/files/home/<foldername_existed>"
- run the setup script.
the backup.sh
script will run daily at 6 PM (default), synchronizing the specified termux directory with your google drive.
automatically trigger backup by running:
sh auto_backup.sh
you can modify cron job time schedule in script by removing #
in auto_backup.sh
file.
manually trigger a backup by running:
sh backup.sh
- restart termux and start cron service.
start service by running:
sv up cron
- check status
sv status cron
- check list
crontab -l
- stop service
sv down cron
to disable the automated backup, run
auto_disable.sh
:
sh auto_disable.sh
you can see backup logs in:
/data/data/com.termux/files/home/rclone.log
- ensure you have internet access when the backup is scheduled to run.
- modify the cron job schedule in
auto_backup.sh
if you prefer a different backup time.
- verify
rclone
is correctly configured and can access google drive. - ensure the paths in the scripts are correct.
- check
rclone.log
for detailed error messages.
Feel free to open issues or submit pull requests for improvements and bug fixes.