Associate Manager and Cake Inspector @ Red Hat. Heavy Metal lover. Amateur photographer. MMA fan. Eternal learner. Opinions my own.
156 stories
·
0 followers

tar: a slop-free alternative to rsync

1 Comment

So apparently rsync is slop now. When I heard, I wanted to drop a quick note on my blog to give an alternative: tar. It doesn’t do everything that rsync does, in particular identifying and skipping up-to-date files, but tar + ssh can definitely accomodate the use case of “transmit all of these files over an SSH connection to another host”.

Consider the following:

tar -cz public | ssh example.org tar -C /var/www -xz

This will transfer the contents of ./public/ to example.org:/var/www/public/, preserving file ownership and permissions and so on, with gzip compression. This is roughly the equivalent of:

rsync -a public example.org:/var/www/

Here’s the same thing with a lightweight progress display thanks to pv:

tar -cz public | pv | ssh example.org tar -C /var/www -xz

I know tar is infamously difficult to remember how to use. Honestly, I kind of feel that way about rsync, too. But, here’s a refresher on the most important options for this use-case. To use tar, pick one of the following modes with the command line flags:

  • -c: create an archive
  • -x: extract an archive

Use -f <filename> to read from or write to a file. Without this option, tar uses stdin and stdout, which is what the pipelines above rely on. Use -C <path> to change directories before archiving or extracting files. Use -z to compress or decompress the tarball with gzip. That’s basically everything you need to know about tar to use it for this purpose (and for most purposes, really).

With rsync, to control where the files end up you have to memorize some rules about things like whether or not each path has a trailing slash. With tar, the rules are, in my opinion, a bit easier to reason about. The paths which appear on the command line of tar -c are the paths that tar -x will open to create those files. So if you run this:

tar -c public/index.html public/index.css

You get a tarball which has public/index.html and public/index.css in it.

When tar -x opens this tarball, it will call fopen("public/index.html", "w"). So, whatever tar’s working directory is, it will extract this file into ./public/index.html. You can change the working directory before tar does this, on either end, by passing tar -C <path>.

Of course, you could just use scp, but this fits into my brain better.

I hope that’s useful to you!


Update: As a fun little challenge I wrapped up this concept in a small program that makes it easier to use:

https://git.sr.ht/~sircmpwn/xtar

Example:

xtar -R /var/www me@example.org public/*
Read the whole story
lasombra
7 days ago
reply
Jesus wept
UK
Share this story
Delete

The Removed DOGE Deposition Videos Have Already Been Backed Up Across the Internet

jwz
1 Share
"What is DEI?"
"Feeeeeeeeemales."
Oh no. Anyway

On Friday, government lawyers in the lawsuit filed a court record which said they asked the plaintiffs to remove the videos "from the internet due to concerns that the publication of the videos could subject the witnesses and their family members to undue harassment and reputational harm." The filing then said that Fox specifically "has been subject to harassment and has received a number of death threats since the videos and video clips were publicized and circulated."

Internet Archive; torrent magnet link (only 5 seeders!)

Previously, previously, previously, previously, previously, previously.

Read the whole story
lasombra
22 days ago
reply
UK
Share this story
Delete

Death By Scrolling Announcement

1 Share

It is with great pleasure, relief and waiting that we can finally announce Death By Scrolling, one of the most anticipated games of 2025.

Wish List now, coming soon.

Read the whole story
lasombra
230 days ago
reply
UK
Share this story
Delete

FastMail -- still good value in 2025?

1 Comment
FastMail is a good, Google-free provider of e-mail, calendar services, and the like. But it isn't the only one, and it's due for a price increase in 2025. Is it time to switch?
Read the whole story
lasombra
252 days ago
reply
I can't recommend mailbox.org enough.
UK
Share this story
Delete

This new macOS Tahoe feature solves a common Mac complaint

1 Comment

9to5Mac is brought to you by CleanMyMac: Tidy up your Mac and iPhone today! Try 7 days free and use our code 9TO5MAC15 for 15% off. Also check out CleanMyPhone for your iPhone!

With macOS 26 Tahoe this year, Apple introduced a new Control Center. Of course, it implements the new Liquid Glass design seen across the entire ecosystem, but it also brings a brand new feature to the Mac for the first time: third-party integrations.

That, on its own, is a big deal, and was a greatly appreciated feature of iOS 18 last year. However, it has an even bigger implication for the Mac.

more…
Read the whole story
lasombra
281 days ago
reply
I love how Apple shifts the blame of poor UI/UX to 3rd party developers
UK
Share this story
Delete

ChatGPT user delighted to combine sloth with theft

jwz
2 Shares
Millions yearn to be creativity-adjacent:

"I've always been jealous of the glory authors get," explained Wolverton, assembling fresh Ikea bookcases to display his newly-published oeuvre. "Actual writing takes time away from surfing for deepfake porn. I just want books with my name on them to impress my friends. ChatGPT made that happen."

Chaz is not alone. Machine learning engineers believe millions yearn to be creativity-adjacent.

"These people are entirely bereft of the basic skills necessary for creativity and they aren't interested developing them," said Victor Drolet, Spicy Autofill Evangelist. "A few could potentially string enough words together into something worth reading, but research shows they will never try."

Egon Hunt, who teaches a $4000, eight-week online prompt engineering course, asserted that "authors" like Wolverton can fulfill dreams of passing as a real-enough writer to those who don't read. "A creative vacuum like Chaz can manage to type in a few prompts, and then the LLM does all the rest." [...]

Accusations that LLMs combine greed with sloth are "narrow-minded", assert experts. With the right prompts, they insist LLM's can deliver far more comprehensive moral transgressions. "In addition to the classical seven deadly sins," adds Drolet, "LLMs even generate entirely new deadly sins such as grath, hoth, and lurm!"

Previously, previously, previously.

Read the whole story
lasombra
315 days ago
reply
UK
Share this story
Delete
Next Page of Stories