I love using rsync…
I use it all the time… it’s a lifesaver!
I will give kudos to things like tar, which can be considerably faster…
e.g. compare these :
$SOURCE
$DEST
Where $SOURCE could be local, or remove, but proably contains gigs (or tibs) or data… $DEST could be remote, or local, and will contain those gigs (or tibs) of data, eventually…
This I have proven is faster than rsync :
cd $SOURCE ; tar cvpf - * | ( cd $DEST ; tar xvpf - )
If there was a network in there, then “tar czvfp”, followed by “tar xzvfp” might make it even faster - but unlikely e.g. if it was just NFS or SMB, cpu overhead might rob any network overhead cost saving…
But - what happens if you need to update / refresh from some kinda “Delta” - well rsync is your tool… piece of cake :
cd $DEST ; rsync -av $SOURCE/ .
But what happens if I wanna delete stuff in $DEST, that might have got copied last time, but has since been deleted off $SOURCE in the intervening period?
Honestly - I don’t know. I’ve just been doing some reading on sourceforge / stack overflow, and it’s DOWNRIGHT confusing, and there’s always uninformed morons piping up and offering opinions, which you read further down are just PLAIN WRONG! Shouldn’t their posts get deleted and them get banned from the whole of the intertoobs?
Some of the recommended options, recommended by some MORONS, will actually delete a file form the f–king SOURCE if it doesn’t exist in the DEST!
Can of worms anyway…
I want to use rsync to keep an exernal SSD refreshed with stuff, for my employer’s MacBook, which has a SHITTY policy of banning writing to external media! That cheeses me off! And it’s got such a tiny shonky little SSD (256) there’s not a chance in hell it could host MacOs AND my music collection… But if I’m going to have script a refresh, I’d rather also delete stuff on the destination, if I’ve already removed it form the source. Is that so hard?
I started writing a script to run in Mac 1, to refresh the external USB SSD contents, to view on Mac 2…
Hidden incase there’s prudes here who can’t handle some colourful four letter words now and then :
Summary
#!/usr/bin/env bash
# fucking corporate piece of shit rules and JAMF SHITE on MacOS
# enterprising sods come up with workarounds...
# in this case we're rsync'ing mp3 / music collection off one Mac, to look at
# read-only on a SOE MOE bullshit macbook
SRC_CUNT=~/ResilioSync/Music
DESTCUNT=/Volumes/SHJTSHEAU/Music
# rsync -avhn --delete $SRC_CUNT/. $DESTCUNT/.
Sorry - I can’t help but swearing…
Now - I’m still unsure, because there’s so many F–KING opinions expressed as “knowledge” on tech help forums - that look dodgy and risky, which one is right???
What will “–delete” do if used BEFORE $SOURCE???