# Creating Jobs

## Overview

A Job is a scheduled operation that is used to perform a backup and comparison of your Project(s) to the current instance in the Copia Server.  Copia provides two options for creating jobs and scheduling backups:

* **Sitewide Backup Schedule (Site Jobs)**\
  A sitewide Job backs up all the projects in a site. At the scheduled start time, a job run for each project will be queued and run in order. This ensures all projects are backed up, without having to configure a job for each project manually.
  * *To configure a Sitewide Backup Schedule see the Site Settings section of the documentation:*  [**Sitewide Backup Schedule**](https://docs.copia.io/docs/sitesandagents/sites/site-settings#sitewide-backup-schedule)<br>
* **Project Backup Schedule (Standard Jobs)**\
  These Jobs have a 1-1 relationships with a Project.  These give you more control over each specific Job setting (such as timeouts, auto-commit settings and more), but may take longer to configure for each project.&#x20;
  * *Continue reading below to setup Jobs for your projects*&#x20;

{% hint style="info" %}
Contact Copia about automated options to create and configure your Jobs!
{% endhint %}

## Creating a Job for a Project

To create a Job, navigate to the *Jobs* tab and press the *Add a Job* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FCKALQ3lSxm73kDFXZ9E0%2FWebApp_AddJob.png?alt=media\&token=d4b28a07-21fb-4a61-b95b-b15162f01735)

### General Settings

You should see a modal that allows you to configure your Job settings. Use the *Project Name* drop-down to select a Project to backup. The name of the chosen Project will be used to automatically populate the *Job Name* field (which can be modified if desired). The *Timeout Duration* refers to the amount of time given to a queued Job. You can modify it if more or less time is needed.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FyjKOSLeGAW25O2wEbf0J%2FWebApp_AddJob_Modal_TopHalf.png?alt=media\&token=7eba4991-8fc6-4818-9ae4-3e88827edb91)

### Scheduling

Scheduling allows you to set how often your Job should run. To turn on the scheduling feature, click the *Schedule Job* toggle.

The *Daily* option preselects weekdays. You can include weekends by enabling the *Include Weekends* checkbox. Use the *Time* selector to set the desired start time for the Job.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FTNslTmWqDxzL6f0Rous5%2FWebApp_Scheduler_Daily.png?alt=media\&token=0af7271e-d440-42b4-aa0a-0ec1377bcef7)

The *Specific day(s) each week* option allows you to choose which days of the week you prefer to perform a Project backup. \_\_ Select which days of the week to run the Job and the set the time the Jobs should run with the *Time* selector.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2F0N1MG332i6DMFTWSdLOW%2FWebApp_Scheduler_Specific.png?alt=media\&token=8dd48956-55d2-4d2b-9599-82b36b81fe70)

If you prefer a more complex schedule, Copia provides the option to enter a "cron" schedule. Cron is a very simple but powerful scheduling format that is commonly used by system administrators. In this case, we provide a link to the [crontab.guru](https://crontab.guru/) site for syntax and [examples ](https://crontab.guru/examples.html)to help you get started. Once you enter a correct cron schedule, a "plain text" interpretation will be displayed above the expression so you can validate your syntax.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FvfUI42KLoe6dAVfP24WF%2FWebApp_Scheduler_Cron.png?alt=media\&token=16348907-1a87-4c24-8061-2d54242c65bf)

### Auto-Commit

Auto-Commit is a feature that allows you to backup, monitor, and be notified if your Devices change without any additional manual involvement. Auto-Commit will create a new branch to store this data so that it does not interfere with development. In this way, Auto-Commit provides easy disaster recovery and access to all machine updates.

When auto-commit is enabled, the device will be compared to the latest commit in the DeviceLink branch. If a difference is detected, a new commit will automatically be created, using the latest backup from the device. In this way the DeviceLink branch should always reflect the current state of the device.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FB3ekANS8ApiylfoY66Bi%2FMisc_AutoCommitDiagram.png?alt=media&#x26;token=edd9a66e-de75-4326-b6ea-9d3fb8fad30b" alt=""><figcaption></figcaption></figure>

The Auto-Commit feature is automatically enabled for new Jobs. By default, Auto-Commit is set to create a new branch with the *DeviceLink/ProjectName* syntax. If development on the Device is rare, or if you wish to use your own branch name, you can enter a new branch name into the *New Branch Name* field.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2F2kKkRvDlam8kEHqohhBM%2FWebApp_AutoCommit_CreateNewBranch.png?alt=media&#x26;token=b87b18bc-bb8a-4e70-8599-d479cecbfb03" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If a user chooses to disable Auto-Commit, they will need to manually create a Pull Request to update the branch that the project is stored on.
{% endhint %}
