How to set up automated environment tasks


To have one more more environments automatically backed up through snapshots triggered without manual intervention.


  • Access to a project hosted on
  • Your project account has administrator rights
  • Knowledge on using the project web interface or the CLI
  • CLI tool set up in the environment, as described in this how-to


The snapshot process is not automated and requires a manual trigger using the CLI or web interface.


1. Check the CLI tool is correctly installed in the environment

After logging in with SSH in the environment, you should be able to run platform and see the welcome prompt, together with a list of your projects.

2. Add a cron for automated environment snapshots

Edit your file and add the snapshot command in a cron. Example:

        # The cron task will run everyday at 4 am (UTC)
        spec: '0 4 * * *'
        cmd: |
            if [ "$PLATFORM_ENVIRONMENT_TYPE" = "production"  ]; then
                 platform backup:create --yes --no-wait

The PLATFORM_BRANCH variable check ensures automatic snapshots are done only on the production environment. The --yes flag skips user interaction for the snapshot command. Ensure the --no-wait parameter is added to the command, in order to make the operation non-blocking (otherwise, your site will be down until the snapshot operation is completed).


After setting up the CLI tool in the environment, we learned how to use it in order to trigger various maintenance tasks for the project.

1 Like