• Re: PSA: RoundSync for automatic Rclone syncing to desktops from Android

    From Maria Sophia@mariasophia@comprehension.com to comp.mobile.android,alt.os.linux,alt.comp.os.windows-10 on Tue Jun 23 00:03:54 2026
    From Newsgroup: alt.os.linux

    Anssi Saari wrote:
    seems to do the same thing?

    I've never heard of RoundSync before.

    I found FolderSync when I was looking for something to replace my rsync
    based backups. I also noticed FolderSync has Tasker support and it
    turned out I had even paid for Tasker maybe a decade earlier.

    So while Tasker is a horrible "automation" thing, after some trial and
    error I got a simple task going which triggers when my phone connects
    to my home wifi. It pings my file server and if that works, then it runs FolderSync to back up my photos and a few other things, using SFTP. So
    in fact it was almost zero setup in the server end, just added a
    key. That's worked for a while now and I'm happy with it.

    I like your humor.
    And your experience.

    That's what Usenet is for.
    Shared knowledge.

    Based on my lookups, FolderSync (and the payware version, Pro), are well respected ways to do cloud management (even if the cloud is SMB on a PC).

    As for Tasker being "a horrid thing", I use the free automation tools,
    Llama Automate, but I do agree with you that it's a horrible thing also.

    Tasker Automate MacroDroid automation
    <https://play.google.com/store/apps/details?id=com.llamalab.automate>
    <https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm>
    <https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid>
    <https://f-droid.org/en/packages/ryey.easer/>

    It works.
    But it has a steep learning curve.

    And... every new version of Android makes everything harder to do.
    At this point, I've given up on "sync" and I just "copy" over Wi-Fi.

    This is my dumb purpose-built copy script, for example, to copy over
    today's camera photos or today's screenshots, as a quickie Wi-Fi copy.

    I don't recommend others use this script, but it does the job for me
    given I never connect the phone over USB but I access it using adb.

    Note: The scrcpy program also has a file copy mechanism, but every
    version of Android makes even that mechanism harder to do easily.

    :: adbcopy.bat
    :: First figure out locations:
    :: /sdcard/Pictures/Screenshots: No such file or directory
    :: /storage/emulated/0/Pictures/Screenshots: No such file or directory
    :: Then figure out file naming conventions
    :: adb shell ls "/storage/0CA4-352D/DCIM/Camera"
    :: 20260521_123358.jpg
    :: FORMAT=Screenshot_YYYYMMDD_HHMMSS_DESCRIPTION.jpg
    :: adb shell ls "/sdcard/Pictures/Screenshots"
    :: Screenshot_20260517_205515_Phone.jpg
    :: Screenshot_20260518_130911_WhatsApp.jpg
    :: Screenshot_20260523_183229_Pulse.jpg
    :: Screenshot_20260611_120637_Nova Launcher.jpg
    :: FORMAT=Screenshot_YYYYMMDD_HHMMSS_DESCRIPTION.jpg
    :: adb pull does not expand wildcards
    :: Wildcards must be expanded inside the shell, not by ADB
    :: v2p3 20260621 added opening the destination folder when done
    :: v2p2 20260621 added screenshot query
    :: v2p2 20260620 Fixed quoting bug in the ls command for DCIM
    :: v2p1 20260617 Added Windows to Android APK copy/install capability
    :: v2p0 20260613 Added Screenshot directory
    :: v1p9 20260528 trim trailing spaces from the destination directory input
    :: v1p8 20260528 replace destructive path truncation with targeted \r stripping
    :: v1p7 20260528 escape redirection character in the backtick loop
    :: v1p6 20260528 update to explicit external SD card path and clean output
    :: v1p5 20260528 fix linux null redirection error and stabilize loop extraction
    :: v1p4 20260528 fix 'unexpected at this time' crash,
    :: v1p3 20260528 fix crash on empty variable comparison
    :: v1p2 20260528 fix multiple-devices error and nested loop quotes
    :: v1p1 20260528 add debug for when it fails
    :: v1p0 20260528 copy images from a given date to a given location

    @echo off
    setlocal enabledelayedexpansion

    cd /d "%~dp0"
    set "ADB_EXE=c:\app\editor\android\scrcpy\adb.exe"

    :: --- DEVICE DETECTION ---
    for /f "skip=1 tokens=1" %%g in ('"%ADB_EXE%" devices') do (
    if not "%%g"=="" (
    if "!ADB_TARGET!"=="" set "ADB_TARGET=%%g"
    )
    )

    if "!ADB_TARGET!"=="" (
    echo [ERROR] No connected ADB devices found.
    pause
    exit /b
    )

    echo Targeting device: %ADB_TARGET%
    echo ----------------

    :: --- MAIN DIRECTION MENU ---
    echo Select Direction:
    echo [1] Android to Windows (Pull Images/Screenshots) [Default]
    echo [2] Windows to Android (Copy/Install APK)
    echo.
    set "CHOICE=1"
    set /p "CHOICE=Enter choice [1 or 2]: "

    if "%CHOICE%"=="2" goto :windows_to_android
    if "%CHOICE%"=="1" goto :android_to_windows
    goto :android_to_windows


    :: ROUTINE: ANDROID TO WINDOWS (ORIGINAL CODE)
    :android_to_windows
    echo.
    echo --- Running Android to Windows Pull ---

    :: --- DATE DETECTION ---
    for /f "tokens=2 delims==" %%i in ('wmic os get localdatetime /value') do set "dt=%%i"
    set "DETECTED_DATE=%dt:~0,8%"

    echo Detected Date: %DETECTED_DATE%
    set /p "USER_DATE=Press Enter to confirm, or type a different date (YYYYMMDD): "
    if "%USER_DATE%"=="" (
    set "TARGET_DATE=%DETECTED_DATE%"
    ) else (
    set "TARGET_DATE=%USER_DATE%"
    )

    echo.
    set "DEST_DIR=H:\004_upload\home\pool\assay\%TARGET_DATE%"
    set /p "USER_DIR=Enter destination directory [Default: %DEST_DIR%]: "
    if not "%USER_DIR%"=="" set "DEST_DIR=%USER_DIR%"

    :: Remove quotes
    set "DEST_DIR=%DEST_DIR:"=%"

    :: Trim trailing spaces
    :trim
    if "!DEST_DIR:~-1!"==" " (
    set "DEST_DIR=!DEST_DIR:~0,-1!"
    goto trim
    )

    if not exist "%DEST_DIR%" (
    echo Creating directory: %DEST_DIR%
    mkdir "%DEST_DIR%"
    )

    echo.
    echo What do you want to pull?
    echo [1] Camera photos (DCIM/Camera)
    echo [2] Screenshots
    set "PULL_CHOICE=1"
    set /p "PULL_CHOICE=Enter choice [1 or 2]: "

    if "%PULL_CHOICE%"=="1" goto :pull_camera
    if "%PULL_CHOICE%"=="2" goto :pull_screenshots
    goto :pull_camera

    :: PULL CAMERA (DCIM)
    :pull_camera
    echo.
    echo Pulling CAMERA images matching *%TARGET_DATE%*.jpg ...
    echo Sending files to: "%DEST_DIR%"
    echo ----------------

    for /f "usebackq delims=" %%i in (`
    %ADB_EXE% -s !ADB_TARGET! shell ls /storage/0CA4-352D/DCIM/Camera/*%TARGET_DATE%*.jpg
    `) do (
    set "FILE_PATH=%%i"
    for /f "delims=" %%r in ("!FILE_PATH!") do set "FILE_PATH=%%r"
    if not "!FILE_PATH!"=="" (
    echo Pulling: !FILE_PATH!
    "%ADB_EXE%" -s !ADB_TARGET! pull "!FILE_PATH!" "%DEST_DIR%"
    )
    )

    :: OPEN DESTINATION FOLDER
    start "" "%DEST_DIR%"

    goto :complete

    :: PULL SCREENSHOTS
    :pull_screenshots
    echo.
    echo Pulling SCREENSHOTS matching *%TARGET_DATE%*.jpg ...
    echo Sending files to: "%DEST_DIR%"
    echo ----------------

    for /f "usebackq delims=" %%i in (`
    %ADB_EXE% -s !ADB_TARGET! shell ls /sdcard/DCIM/Screenshots/*%TARGET_DATE%*.jpg
    `) do (
    set "FILE_PATH=%%i"
    for /f "delims=" %%r in ("!FILE_PATH!") do set "FILE_PATH=%%r"
    if not "!FILE_PATH!"=="" (
    echo Pulling screenshot: !FILE_PATH!
    "%ADB_EXE%" -s !ADB_TARGET! pull "!FILE_PATH!" "%DEST_DIR%"
    )
    )

    :: OPEN DESTINATION FOLDER
    start "" "%DEST_DIR%"

    goto :complete

    :: FINALIZE
    :complete
    echo Process complete
    pause

    REM end of adbcopy.bat

    Note that if this quick-and-dirty script were meant to be general use,
    I'd make it figure out the paths and file names all by itself.
    --
    Usenet is where kind-hearted well-educated people gather to exchange ideas.
    --- Synchronet 3.22a-Linux NewsLink 1.2