Without this, we try to write the config for the app even though it doesn't exist anymore, causing issues with deleting apps with invalid cron configs.
The implementation was very heavily docker-local specific and thus didn't make a ton of sense to keep in the cron plugin.
This also re-introduces changes from #5908 to parallelize the crontab generation (which is also specific to the docker-local scheduler) that were lost during a rebase.
The impetus for this change was implementing a `cron:run` command. The logic for actually running the command isn't scheduler specific - merely invoking `dokku run` with the appropriate arguments - but all the logic around how the commands were retrieved were, so the change was made pre-emptively.
RHEL blocks users from executing crontab as themselves Because Of Reasons so we need to use sudo instead.
Also refactors file writing to properly support writing the permissions on sudoers files going forward.
Closes#5020
This allows alternative plugins - such as dokku-letsencrypt - to inject scheduled cron tasks into the cron system used by Dokku. Cron systems can choose to include or not include a cron task based on the specified scheduler, and can also optionally use a third parameter to store arbitrary information.
This functionality enables users to manage a global crontab for the Dokku user that contains all scheduled tasks across all apps. Alternative schedulers can implement cron tasks as desired.