Files

The content root is one folder of self-contained cron directories, mirrored to your server. Every top-level entry is either a cron (a directory holding the handler and the settings), ignored (a _-prefixed or dotted name), or a plain directory that rides along unscheduled. This page is the map from path to role.

A content root

<cronhoster-config-contentRoot>/
  digest/                         a cron
    cronhoster-cron-handler.js    the entry point the runner runs
    cronhoster-cron-settings.json the schedule and concurrency ceiling
    format.js                     a module it imports, never run alone
    node_modules/                 vendored deps, resolved inside this cron
  backup/                         another cron
    cronhoster-cron-handler.js
    cronhoster-cron-settings.json
  _staged/                        ignored, a staged next version
    cronhoster-cron-handler.js
    cronhoster-cron-settings.json
  .gitignore                      ignored, a dotfile
A content root holding two crons, a staged draft, and an ignored dotfile.

Path patterns

Path patternRoleNotes
<name>/ (top level)CronAny top-level directory holding both files below. The directory name is the cron name. See Settings.
<cron>/cronhoster-cron-handler.jsEntry pointThe one file the runner runs for that cron.
<cron>/cronhoster-cron-settings.jsonSettingsThe cron's schedule and concurrency ceiling.
<cron>/** (anything else inside)Bundled moduleUploaded with the cron and imported by its handler. Never run on its own.
<cron>/node_modules/**Bundled moduleResolved by require and import inside that cron like any dependency.
_* (any name starting with _)IgnoredNever synced, never run. Staged next versions and any other local-only file.
.* (dotfiles and dotfolders)IgnoredEditor and VCS files stay local.

What makes a cron

A cron is any top-level directory that contains both a cronhoster-cron-handler.js and a cronhoster-cron-settings.json. The directory name is the cron name, and it carries no timing: the schedule lives entirely in the settings file. A top-level directory missing either file is left alone, and nested directories are never crons.

If the settings file fails to parse, the cron is left unscheduled and the runner notes it once. Use ordinary, portable filename characters for a cron name: letters, digits, and - or _ mid-name are fine. Avoid spaces and path separators.

Ignore rules

Two kinds of name take an entry out of play entirely, at every level. They are never synced and never run:

PrefixApplies toUse
_Any file or folder nameStage the next version of a cron before it goes live, or keep any local-only file out of the sync.
.Dotfiles and dotfoldersEditor state, .git, and .DS_Store stay on your machine.

The rule is by name, so a whole _staged/ directory is ignored while you build it, and a _scratch/ folder is a handy local-only area inside the content root.

Sync-once immutability

A cron directory uploads whole the first time it appears on the server and is then never re-synced. The local scripts compares top-level directory names only, so a cron the server already has is left untouched even if you change files inside it locally. A cron the server has but you no longer keep is removed. To change a live cron you publish a new directory under a new name, staged as _name while you work and renamed to go live. There are no shared files to reconcile, which is what makes versioning simple.

See also