You might not even like rsync. Yeah it’s old. Yeah it’s slow. But if you’re working with Linux you’re going to need to know it.

In this video I walk through my favorite everyday flags for rsync.

Support the channel:
https://patreon.com/VeronicaExplains
https://ko-fi.com/VeronicaExplains
https://thestopbits.bandcamp.com/

Here’s a companion blog post, where I cover a bit more detail: https://vkc.sh/everyday-rsync

Also, @BreadOnPenguins made an awesome rsync video and you should check it out: https://www.youtube.com/watch?v=eifQI5uD6VQ

Lastly, I left out all of the ssh setup stuff because I made a video about that and the blog post goes into a smidge more detail. If you want to see a video covering the basics of using SSH, I made one a few years ago and it’s still pretty good: https://www.youtube.com/watch?v=3FKsdbjzBcc

Chapters:
1:18 Invoking rsync
4:05 The --delete flag for rsync
5:30 Compression flag: -z
6:02 Using tmux and rsync together
6:30 but Veronica… why not use (insert shiny object here)

  • oddlyqueer@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    12 hours ago

    This is why I still don’t know sed and awk syntax lol. I eventually get the data in the shape I need and then move on, and never imprint how they actually work. Still feel like a script kiddie every time I use them (so once every few years).

    • tal@olio.cafe
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      12 hours ago

      sed can do a bunch of things, but I overwhelmingly use it for a single operation in a pipeline: the s// operation. I think that that’s worth knowing.

      sed 's/foo/bar/'  
      

      will replace all the first text in each line matching the regex “foo” with “bar”.

      That’ll already handle a lot of cases, but a few other helpful sub-uses:

      sed 's/foo/bar/g'  
      

      will replace all text matching regex “foo” with “bar”, even if there are more than one per line

      sed 's/\([0-9a-f]*\)/0x\1/g  
      

      will take the text inside the backslash-escaped parens and put that matched text back in the replacement text, where one has ‘\1’. In the above example, that’s finding all hexadecimal strings and prefixing them with ‘0x’

      If you want to match a literal “/”, the easiest way to do it is to just use a different separator; if you use something other than a “/” as separator after the “s”, sed will expect that later in the expression too, like this:

      sed 's%/%SLASH%g  
      

      will replace all instances of a “/” in the text with “SLASH”.