💾 Archived View for yretek.com › english › 2023-04-14_rsync_gt_ssh.en.gmi captured on 2023-07-22 at 16:26:25. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-19)

➡️ Next capture (2023-09-28)

-=-=-=-=-=-=-

Yretek - Rsync > SSH

Forgive me if I'm wrong, amateur coder at the wheel, but it surprises me to see quite a few people talking about ssh'ing into their capsules. I don't think that's the best approach.

What I do is to work locally on a local folder, check that everything's fine and then synchronize the local and the remote folder using rsync. It's not that hard to use at all. This is my magic line:

rsync -rtvzP --delete /home/mylocalusername/mylocalfolder/ myserveruserid@example.org:/home/gemini/oryourremotefolder/content

That --delete thing is meant to delete extraneous files from the target folder.

But that's hard to remember! I hear you say? Just use an alias. Go and edit .bash_aliases and add one! Something like:

alias youralias="rsync -rtvzP --delete /home/localusername/localfolder/ serveruserid@example.org:/home/remotefolder/content"

Oh, and then remember to activate it by the way of `source ~/.bash_aliases`

My own alias is called yretekea, so all I need to do is to type yretekea and everything is uploaded.

One good benefit of going this way is that I'm not messing up with my server. Or I'm messing less with my server. Secondly, I have kind of a back up by default if something happens to either my server or my local machine. Thirdly, I can draft to my hearts desire knowing that nobody will ever access my master piece until it's finally polished to Finnish standards.

So, no, it's not a super-duper, 'you've all been doing this wrong', kind of thing. But I do believe it's a better, safer and more logical way to go.

Footer

~ Miguel de Luis Espinosa

yretek@proton.me

@yretek@im-in.space My Mastodon.