Pushing to My Site from My Phone

I can now push to my site from my phone via rsync! I added my Termux install’s ssh pub key to my nearlyfreespeech.net account. I wrote a one line script to make the rsync call that Guillermo Garron describes on his blog:

rsync -v -rzz --checksum --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r --delete <path-to-site>/ <user>@<server>:/<path>

I had to install rsync via the following command:

pkg install rsync

The -z compression option Garron recommends doesn’t work in Termux but switching to -zz (as the command’s own warning states) does work.

I also found that I can’t use --delete right now because I still can’t build my less based css on my phone. So hugo’s public folder is missing some stuff that it needs. I’ve added a TODO to the script to re-add the flag when I get that working.

UPDATE: After writing this I found that I was having some permissions issues. Therefore I’ve updated the command with a chmod to set folders 755 and the files to 644 per instructions from Server Fault. I was also able to write a termux compatible build. So I’ve re-added --delete.

UPDATE 2022-11-26: This is now part of a series of mini articles I’ve written about building my hugo site from my phone. You can find info on setting up termux and git clone here and info on setting up hugo itself here.