Last week, I setup termux on my phone to run some analytics on the go.

TODO Termux .bashrc

TODO Termux python Pip does not work for compiled modules as termux requires some modifications. https://github.com/termux-user-repository/tur https://wiki.termux.com/wiki/Python

Whenever I connect my phone to PC I want to run some data syncronization automatically. TODO also sync notes

I’ve found out respective event ID by observing Windows Event Viewer…

TODO SCREENSHOT https://techcommunity.microsoft.com/t5/ask-the-directory-services-team/advanced-xml-filtering-in-the-windows-event-viewer/ba-p/399761

<QueryList>
  <Query Id="0" Path="Microsoft-Windows-DeviceSetupManager/Admin">
    <Select Path="Microsoft-Windows-DeviceSetupManager/Admin">*[System[(EventID=112)]] and *[EventData[Data[1]='Mi 9 Lite']]</Select>
  </Query>
</QueryList>

TODO setup rclone termux connection https://rclone.org/

Assign task

adb forward tcp:8022 tcp:8022                       :: forward port 8022 for ssh connection
adb shell am start -n com.termux/.HomeActivity      :: launches termux, starts sshd
rclone sync "termux:SRC_PATH" "WINDOWS_DEST_PATH"   :: to sync from termux to windows
:: for bidirectional sync
rclone bisync --resilient --recover --max-lock 2m --slow-hash-sync-only TERMUX_PATH WINDOWS PATH