I have a laptop and a phone in which termux is installed. I want to move files from my phone to my computer using rsync if all files are older than 30 days. I think I should use find command with -exec rsync.

find . -mtime +30 -exec rsync something 

but the problem is my phone’s IP address is always changing so how do I transfer file? I have to run this script in my laptop

  • Xanza@lemm.ee
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    12 hours ago

    VPN… This is a specific problem that VPNs were created to solve.

    On your Wireguard network (or whichever), note your vLAN IPs, and configure rclone/rsync with them like normal. Ensure you’re connected to Wireguard and then run your command;

    ❯ fd --change-older-than 30days -X rclone sync phone:my/path/here pc:destination/path/here
    

    Using a VPN ensures that regardless of WiFi/Cellular connections you’ll still be able to transfer at home, or remotely. Using methods like hostnames only work locally.

  • catloaf@lemm.ee
    link
    fedilink
    English
    arrow-up
    15
    ·
    21 hours ago

    DNS was invented in 1985 to solve this problem.

    You could also run it from the phone.

  • RedSnt 👓♂️🖥️
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    21 hours ago

    Yeah, like @catloaf@lemm.ee said, Dynamic DNS ought to fix this issue. There are plenty of free ones. I currently use ClouDNS, but No-IP is also decent.
    Hardest part is updating from a phone, but there’s articles on both sites for how to do that.

  • BaumGeist@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    21 hours ago

    Is your phone running a GNU distro or rooted Android, or is it just regular Android with a Termux chroot?