Replacing FTP with Rsync For my Blog
Reading Time: 4 minutesRecently I have been playing with rsync a lot. In the process of synching source A to B, as well as synching between machines I have grown familiar with how it works. It is for this reason that the move from using ftp for rsync to update the static part of the website began to make sense.
When I write a blog post I update wordpress with the markdown from the static blog post and then I run hugo to prepare the static site. I then used Filezilla to upload the changed files.
With a blog that is updated daily, it's not that I update two or three files. The blog post page is created of course, but the navigation from plenty of pages needs to be updated at the same time. The result is that filezilla needs to compare, and transfer hundreds of files on a daily basis.
As I use one computer for blogging, and another for other tasks the time it takes Filezilla via FTP to work through the list is time that I'm stuck waiting.
With rsync, with rsync -av --dry-run /local/path/ user@remote_host:/remote/path/ I can update the blog as soon as Hugo has run, within seconds, and from the command line rather than a dedicated app. I'm suggesting the "--dry-run" flag so that you can double check that it is doing what you expect before running it without the flag.
Getting a Push from AI
In my eyes vibe coding apps, and getting AI to write blog posts or create photographic kitsch and videos is deeply immoral. Asking AI to help you use understand tools such as rsync is worthwhile.
It's not that we can't read the manual. It's not that the manual is hard to understand. It's that sometimes we learn and think differently than those that wrote the man pages. We might not have the right context to understand the nuance of what was written.
Many times I have wanted to use a tool, read the man page, failed to understand it, tried two or three things and got nowhere. I spent half a day or more trying to get Ghost to work on an Infomaniak Node.js server without success despite asking for AI for help.
The Grsync Stepping Stone
More than once I used grsync to back up a linux machine and it works well. I can look at the interface and see the options, but it would take reading the fabulous manual to understand what everything does. I was happy with Grsync for a while.
The Gemini Advantage
With Gemini, I will say, "I want to sync the Hugo publish output from my local machine to my web server. Which flags are optimal for this task. I would also like to run it without using the password. What does that involve" and it will generate the prompt as well as explain what each prompt does and why it's used.
Beware Hallucinations
When you are given a prompt make sure that you understand it before running it, and if you do run it, try a dry run. If the output is not too long you can feed it to Gemini and ask if you can proceed. You can also say "I noticed that the output seems wrong in this manner" and it will help you debug. More than once it caught that I was missing a "/" at the end of a source. In that case the folder and it's contents would be moved, rather than just the contents.
Long Conversations with Gemini
If you're curious why I favour Gemini over Euria, MyAI, Le Chat and other solutions, it's because I rarely if ever get it telling me that I am out of tokens. Instead it hallucinates more and more. If you're playing with rsync (By playing I mean learning) you can often get long outputs and these long outputs can quickly get Gemini to hallucinate.
Who cares?
When you're learning to use rsync, you can ask it to be verbose to see what it's doing. Since that output can cover hundreds, if not thousands of lines, you can ask gemini to help you with grep and other tools to check that what you expect is happening, for quality control and quality assurance.
If you did this by eye, and by skimming you might miss something that AI, due to its optimisation for dealing with big data, might help you with.
AI as Patient Tutor
Reading a man page will tell you about the diversity of flags and how to use them but you might have reservations about trusting that you have understood what prompts do. That's where AI as a patient tutor comes in. I might run command A once, twice, three times, and with each run I become more confident, in part because Gemini or another "tutor" confirms that what I'm doing is right. It doesn't mind repeating a lesson until it sinks in.
Move From Host to Host
Imagine, you are with a web host and you have files on Hosting Solution A and Hosting Solution B. My natural instinct was to FTP the files from the web host locally, and then to ftp them back up to Hosting Solution B. Gemini said "Use rsync" and because I had experimented with ssh and transferring files via rsync locally and remotely the idea grabbed me, so I experimented, and that's why I changed how I update my blog.
And Finally
I was using rsync a lot, for moving around and synching photos between drives. In the process my confidence with this tool grew. I also grew more familiar with using rsync between machines within my "home lab" so it became a small leap to go a step further, to sync my blog.
Thanks to Gemini being my "tutor/mentor" I broke my 29 year habit of using FTP.
#filezilla #ftp #rsync