💾 Archived View for gemini.complete.org › filespooler-in-cron-and-systemd captured on 2024-07-09 at 01:00:16. Gemini links have been rewritten to link to archived content

View Raw

More Information

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

Filespooler in cron and systemd

Filespooler[1] is designed to work well in automated situations, including when started from cron or systemd. It is a fairly standard program in that way. I'll discuss a few thoughts here that may help you architect your system.

1: /filespooler/

Generally, the command you would schedule is `fspl queue-process` so that's the assumption here.

Output

By default, Filespooler produces no output itself on success. The commands it executes may, and Filespooler may also when error conditions occur. This can make it a nice match for cron, which would send emails on output.

One thing to consider is that if you run `fspl queue-process` frequently -- say every 5 minutes -- if you have a job that causes an error, that could cause you to get an email every 5 minutes. You may want some other method of detecting failure -- for instance, periodically looking for the presence of jobs in the queue after running queue-process, or perhaps not masking the queue-process output once a day.

Locking

Filespooler is designed such that only one `fspl queue-process` can run at a time (on a given machine, anyhow). This is helpful in the sense that if a long running job spills over into your next execution, it the next execution will immediately fail with an error rather than cause corruption.

Power consumption

Filespooler itself is very lightweight, but the jobs you execute may not be. If you are using systemd timers, the accompanying .service file can contain `ConditionACPower=true` which will only run the queue processor when your mobile device is charging. Very nice.

Command Output

You may have various considerations for how to handle the output of the commands you execute. See Handling Filespooler Command Output[2] for ideas.

2: /handling-filespooler-command-output/

--------------------------------------------------------------------------------

Links to this note

3: /filespooler/

Filespooler lets you request the remote execution of programs, including stdin and environment. It can use tools such as S3, Dropbox, Syncthing[4], NNCP[5], ssh, UUCP[6], USB drives, CDs, etc. as transport; basically, a filesystem is the network for Filespooler.
Filespooler is particularly suited to distributed and Asynchronous Communication[7].

4: /syncthing/

5: /nncp/

6: /uucp/

7: /asynchronous-communication/

More on www.complete.org

Homepage

Interesting Topics

How This Site is Built

About John Goerzen

Web version of this site

(c) 2022-2024 John Goerzen