this post was submitted on 23 Jun 2025
64 points (97.1% liked)
Linux
8054 readers
708 users here now
A community for everything relating to the GNU/Linux operating system
Also check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I have a computer and 3 devices I wanted to transfer files between but every available solution was either too awkward which made things annoying, or too bulky with more than what I needed.
I ended up writing a long script (around 1000 lines but I'm generous with spacing so I can read my own code easily) using
rsync
to deal with transferring files and whole directories with a single command. I can even chain together multiple rsync commands back to back so that I can quickly transfer multiple files or directories in one command. Instead of trying to refer to a wall of text full of rsync commands, I can make something like this:alias rtPHONEmedia="doas rtransfer /home/dell-pc/.sync/phone/.sync-phone_02_playlists /home/dell-pc/.sync/phone/.sync-phone_03_arbeit /home/dell-pc/.sync/phone/.sync-phone_04_albums /home/dell-pc/.sync/phone/.sync-phone_05_soulseek /home/dell-pc/.sync/phone/.sync-phone_06_youtube"
This will copy everything from a specific folders on my phone, and store them neatly organized into my storage partition on my computer SSD. This also includes all the necessary information including SSH username, address and ID keys.
I can then run
alias rtARCHIVEfull="doas rtransfer /home/dell-pc/.sync/computer/.sync-computer_01_archive-full"
to quickly copy that storage partition on my computer to my external backup SSD.I use it so often. It's especially nice because I can work on a file on my computer and quickly update the file to the remote address location, putting it directly where I need it to be immediately.