💾 Archived View for tilde.pink › ~tarial › gemlog › 20220623_troubleshooting_anacron.gmi captured on 2023-01-29 at 04:45:42. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
Recently I've swiched from Fedora to Endeavour OS, because I wanted to try a rolling release distro. With a change like that, I expected some things maybe needed adjusting. I quickly found I needed to figure out why my daily running script that creates backups of my files did not run.
To create my back-ups I use borgbackup, a.k.a. borg. To schedule the daily creation of the back-ups, I use anacron in conjunction with cron. Anacron executes a very simple script that's barely more than the command borg needs in case you create a backup manually.
When I found out things weren't working as the were supposed to, I checked the following:
It should be working, and it wasn't. What in the world could be the problem? Oh, wait. Let's test the command anacron uses (anacrontab) to trigger the back-up script. Bingo! There's the problem. But how can THIS be the problem? I copied the command straight from `/etc/anacrontab`, which came with the operating system, and I only adjusted a few minor things.
Anacron runs `nice run-parts $HOME/.anacron/etc/cron.daily`. The important part is `run-parts $HOME/.anacron/etc/cron.daily`, and that didn't do anything. No scripts were run, no errors were given, nothing. Run-parts was installed, and when run without arguments, or with `--help` or `--version` it spit out the info you'd expect. Yet, it didn't run my scripts.
It took far too long before before I saw there was a `--debug` option; this option was the key to success. When running run-parts with the --debug option, it gave a weird error message:
".": classicalre fail "..": classicalre fail "100-backup.sh": classicalre fail "110-prune.sh": classicalre fail "120-compact.sh": classicalre fail
The error "classicalre fail" lead me to run-parts source code, and the realization the names of my scripts were the problem. What was documented in the run-parts man page, which I read, was that a the name of a script run by run-parts could contain ASCII uppercase characters, ASCII lowercase characters, ASCII numbers, and ASCII underscores. That's pretty much what you'd expect right? Well, no. It didn't say the filenames could contain dots, because they couldn't. The names of my scripts, the scripts that worked under Fedora, were a problem because they contained dots they couldn't have. *SIGH*
That was a sigh of relieve, frustration, and of effin' *facepalm*, because who in the world would even start to assume that in 2022 an executable file with a name that has a dot in it could be such a problem it cannot run.
Published: 2022-06-23