15

!rant
rsync is the best thing since sliced bread

Comments
  • 0
    What is it? (Sorry for my ignorance!)
  • 0
    @TechnoTrumpet its like scp with super powers
  • 1
    @azous Sorry again for my ignorance, but what's scp?
  • 2
    @TechnoTrumpet scp is like cp but secure (e.g. over ssh)

    So for copying files in Unix systems:
    - cp for local copies
    - scp for copying from local to a remote server (e.g. server to server copies) or remote to local.

    Then you have rsync.. that works on magic. It compares the source and destination that you specify and then figures out what needs to be copied/deleted to sync the two. Effectively you could use it for incremental updates (e.g. say you have 100gb of files that need syncing but only 2gb has actually changed since the last time you copied it).

    Rsync can be used to copy local->local, local->remote, remote->local...
  • 1
    Exactly! It's great over dodgey connections cause it doesn't have the same timeout/stall issues; same Newton speed, but vastly different performance!
  • 0
    I have to help re write a script that tells us when our machines can't rsync. Right now a script runs and guess oh

    PotatoComp can't rsync, should this be in excludes (to not be auto rsynced)?

    Not giving us any useful info on the system, whether it's still on the network, pingable or even in use.

    I only have to help cause I wrote a py script to get me that info so I could hunt machines down.

    I'm on the bottom rung of the dept (like the legs compared to the guys writing these scripts are the brains) and I'm being told I should just fix their script heh.. Like I'm not even paid enough for my bills let alone enough to fix your script while doing my actual job... Frustrating...(friggin rsync)
  • 0
    @TEvashkevich err... Rsync runs a process in both ends, so for remote connections you need to also specify the install path to rsync if it's not standardized.

    Plus there's a whole ton of exit codes that rsync uses for different reasons, some critical, some not.

    I'd lean towards just doing it all in shell scripts though...
  • 1
    @deMark yup shell and automated is how it's going. But sometimes comps fall off the network and it can't run and another script checks the last date it ran and gives me the useless potato output
  • 0
    @TEvashkevich hmm I'm thinking this should just be done via error handling of rsync command? It has a ton of non-zero exit codes so it would make sense if there was one where it can't connect to the target host.

    Your script should catch $? then decide what to do with it when it's non zero, like log it and alert someone.
  • 0
    @deMark likely. Not my script though. I'm just dealing with the shit output it gives. Written by someone else and I don't get paid enough to fix that
  • 0
    @deMark Thanks! I am very new to Linux, so you just taught me something.
Add Comment