Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To run Termux scripts from Tasker, install the Termux:Tasker plugin, grant Tasker Termux’s RUN_COMMAND permission, then add a plugin action that runs an executable script from ~/.termux/tasker/. For scheduled jobs, start with background execution: it can return output and an exit result without opening a terminal. That connects the apps, but it does not guarantee Android will keep every long-running command alive all night; duration, timeouts, Android restrictions and your phone’s power management all matter.

How Tasker hands a command to Termux

Tasker does not run Linux commands inside its own environment. A Tasker profile triggers a Termux:Tasker plugin action; the plugin asks Termux to execute a script in Termux’s environment. The official Termux:Tasker documentation describes configuring an executable in ~/.termux/tasker/ and choosing either background execution or a new terminal session.

This walkthrough assumes Termux and Termux:Tasker are installed and Tasker is available on your device. F-Droid listed Termux:Tasker version 0.9.0, added September 5, 2025, with Android 5.0 or later as its requirement when that listing was checked; release information can change. See the F-Droid listing for its current status. Tasker is a separate, non-free dependency according to that listing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Put a test script in Termux’s tasker directory

Use Termux’s private home directory for your automation script. It avoids relying on shared-storage access and is the documented default location the plugin searches. In Termux, create a small script such as this:

mkdir -p ~/.termux/tasker
cat > ~/.termux/tasker/night-check.sh <<'EOF'
#!/data/data/com.termux/files/usr/bin/sh
printf 'Tasker started this script at %sn' "$(date)"
exit 0
EOF
chmod +x ~/.termux/tasker/night-check.sh
~/.termux/tasker/night-check.sh

The final command runs the script directly so you can catch errors before adding Tasker. Replace the sample body with the commands you actually need. Keep scripts out of broadly writable shared storage when possible; a private Termux location is a better default for executable automation.

The plugin documentation says files in ~/.termux/tasker/ have execute permissions set automatically when the plugin action runs, but the directory must be readable and executable for scripts to be found and run. Setting the script executable yourself and testing it directly makes the setup easier to diagnose.

Grant Tasker permission to run Termux commands

For Termux:Tasker 0.5 and later, the host app needs the Android permission com.termux.permission.RUN_COMMAND. The project notes that Tasker has requested this permission since Tasker 5.9.3; on some devices you must grant it manually in Android settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open Android Settings and go to Apps.
  2. Open Tasker, then its Permissions screen. Depending on the Android version or device manufacturer, labels or nesting may differ.
  3. Find the Termux command permission, shown as com.termux.permission.RUN_COMMAND or a related Termux permission entry, and allow it if Android exposes it.
  4. If you cannot find it, open Termux and confirm Termux:Tasker is installed, then return to Tasker’s app permissions. Permission availability and labels can vary by Android build.

The permission lets the authorized host app request commands in Termux’s context. Treat access accordingly: the Termux project cautions that a relatively untrusted app with RUN_COMMAND access could run arbitrary commands in that context if external-app execution is enabled.

Add the Termux:Tasker action

Create or open the Tasker task you want to run, then add an action from the plugin. The exact screen labels can vary with Tasker versions, but the documented flow is to choose the plugin action and configure its executable.

  1. In Tasker, open the task, tap + to add an action, then choose Plugin and Termux:Tasker.
  2. Tap the configuration or edit control for the plugin action.
  3. Set the executable to night-check.sh, the filename you saved in ~/.termux/tasker/.
  4. Choose Background execution for a scheduled job that does not need a visible terminal. This is the documented default.
  5. Save the plugin configuration and the Tasker task. Run the task manually once and inspect the result before relying on a schedule.

For scripts outside ~/.termux/tasker/, the plugin requires an absolute path and Termux’s allow-external-apps=true setting. That setting broadens what an app with RUN_COMMAND access may invoke; it is not necessary for the private-directory setup above. Use it only when you deliberately accept that wider access.

Choose background mode or a terminal session

These modes serve different jobs; a terminal session is not simply a more reliable version of background execution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Execution mode What it is for Returned result Important limitation
Background Scheduled work that does not need a visible terminal; documented default. When Tasker waits for the result, the action can return separate standard output, standard error and an exit result. Long-running commands can outlast Tasker’s action timeout, and Android may kill the plugin host. A longer timeout does not ensure persistence.
New terminal session A command that benefits from a visible Termux terminal session. Output is a combined terminal transcript, not separate standard output and standard error. On Android 10 and later, restrictions on starting activities from the background can prevent the terminal from opening automatically.

The Termux documentation says that Android 10 and later may require you to tap the Termux notification to bring up a terminal session; granting the optional Draw over other apps permission may allow automatic start. This activity-start restriction concerns terminal-session commands, not background commands.

Wait for results without mistaking a timeout for success

If a later Tasker action needs the command’s output or exit result, configure the plugin action to wait for the result. The Termux:Tasker project documents a default action timeout of 10 seconds and advises increasing it for a longer background command. Set a value that fits the expected runtime, then check what the action actually returned.

  • Exit result: tells you how the command ended; a successfully launched plugin action does not necessarily mean the script completed successfully.
  • Standard output and error: in background mode, inspect both to see normal output and diagnostic messages. The project says the combined output of these streams is truncated at 100 KB, so do not depend on receiving unlimited logs.
  • Timeout: if a command exceeds the action timeout, result variables may not be returned. The project also warns that Android can kill the plugin host during a long run even if you increase the timeout.
  • Runtime: keep the first test short. For work that can run for a long time, test the actual command and phone behavior rather than assuming that the timeout setting keeps it alive.

For a reliable overnight workflow, test the scheduled task on the same phone with the screen off and for at least the duration you expect it to run. Check Tasker’s action result and the script’s own logs or output. Android’s background limits and manufacturer-specific battery policies mean the documentation does not promise identical unattended behavior across devices.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Fix common setup failures

The plugin action cannot run a command

Check that Tasker has com.termux.permission.RUN_COMMAND, especially with Termux:Tasker 0.5 or later. The project notes that Tasker versions may report a missing-permission failure differently in %err and %errmsg, so inspect the error fields available in your Tasker setup rather than relying on one field alone.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The script is not found

Confirm the configured executable name matches the file in ~/.termux/tasker/, and verify the directory has read and execute access. Run the script directly in Termux to distinguish a script error from a plugin configuration problem.

The task stops or returns no result

Compare the command’s runtime with the plugin action timeout, make sure result waiting is configured if you need returned values, and check for output large enough to be truncated. An increased timeout is not a guarantee against Android stopping the plugin host.

A terminal session does not open

If the action uses a new terminal session while Tasker is in the background, Android 10 or later may block the activity start. Try tapping the Termux notification, or consider the optional Draw over other apps permission if automatic launch is important. If the command needs no visible terminal, switch to background mode.

The script cannot read or write a shared-storage file

Access to a script in Termux’s private home directory is separate from access to paths such as /sdcard or /storage/emulated/0. If your command uses shared storage, check Termux’s storage permission and the path you used. The Termux RUN_COMMAND documentation describes command execution in Termux’s context and related permission considerations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.