3

If I run

sudo crontab -e

I can edit the crontab, but it's read-only so nothing gets saved.

4

You're right, you can't edit the crontab in Snappy Ubuntu Core. Personally I just create a service that sleeps. For instance, say there was an operation you wanted to run every 15 minutes. Put it in a shell script named my_service.sh:

#!/bin/sh
while true; do
    do_my_thing
    sleep 15m
done

Make it executable. Now create something like the following snapcraft.yaml:

name: foo
version: 1
summary: My snap
description: My snap

apps:
  my-service:
    command: my_service.sh
    daemon: simple

parts:
  foo:
    plugin: copy
    files:
      my_service.sh: bin/

If you install the resulting snap you'll have that service with do_my_thing running every 15 minutes. If your timing requirements are more complicated (e.g. run every Sunday at 0200) you can still pull this off, but it of course gets a bit more complex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.