You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/snapshot-instances-jobs/index.mdx
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,62 +13,61 @@ dates:
13
13
validation: 2025-12-03
14
14
posted: 2024-06-19
15
15
---
16
-
17
16
[Scaleway Serverless Jobs](/serverless-jobs/quickstart/) allows you to create and automate recurring tasks. This tutorial will guide you through the process of creating snapshots of a [Scaleway Instance](/instances/quickstart/) on a recurring schedule using a Serverless Job.
18
17
19
-
Serverless Jobs are perfectly adapted for these autonomous tasks, as we do not need autoscaling or exposure via a web server. Refer to the [differences between jobs, containers and functions](/serverless-jobs/reference-content/difference-jobs-functions-containers/) for more information.
18
+
Serverless Jobs are perfectly adapted for these autonomous tasks, as we do not need autoscaling or exposure via a web server. Refer to the [differences between jobs, containers, and functions](/serverless-jobs/reference-content/difference-jobs-functions-containers/) for more information.
20
19
21
20
<Macroid="requirements" />
22
21
23
-
- A Scaleway account logged into the [console](https://console.scaleway.com)
24
-
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
25
-
- Created an [Instance](/instances/how-to/create-an-instance/)
22
+
- A Scaleway account logged into the [console](https://console.scaleway.com).
23
+
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization.
24
+
- Created an [Instance](/instances/how-to/create-an-instance/).
26
25
27
26
## Creating the Job Definition
28
27
29
28
1. In the [Scaleway console](https://console.scaleway.com), click **Jobs** in the **Serverless** section of the side menu. The jobs page displays.
30
29
31
30
2. Click **Create job**. The job creation wizard displays.
32
31
33
-
3.**Container Image** select **External** and in **Image URL** set: `scaleway/cli:latest`
32
+
3.For **Container Image**, select **External** and in **Image URL**, set: `scaleway/cli:latest`.
34
33
35
34
4. Enter a name or use the automatically generated one.
36
35
37
36
5. Select the region in which your job will be created.
38
37
39
-
6. Keep default **resources** values, as this job requires little compute capabilities.
38
+
6. Keep default **resources** values, as this job requires little compute capability.
40
39
41
-
7. Set **cron schedule** to `0 2 * * *` and select relevant time zone to run the job every day at 2:00 a.m. Refer to the [cron schedules documentation](/serverless-jobs/reference-content/cron-schedules/) for more information.
40
+
7. Set **cron schedule** to `0 2 * * *` and select the relevant time zone to run the job every day at 2:00 a.m. Refer to the [cron schedules documentation](/serverless-jobs/reference-content/cron-schedules/) for more information.
42
41
43
42
8. Define the following environment variables:
44
-
-`SCW_ACCESS_KEY`: your API access key
45
-
-`SCW_SECRET_KEY`: your API secret key
46
-
-`SCW_DEFAULT_PROJECT_ID`: your Project ID
47
-
-`SCW_DEFAULT_ORGANIZATION_ID`: your Organization ID
48
-
-`SCW_DEFAULT_REGION`: Concerned region
43
+
-`SCW_ACCESS_KEY`: your API access key.
44
+
-`SCW_SECRET_KEY`: your API secret key.
45
+
-`SCW_DEFAULT_PROJECT_ID`: your Project ID.
46
+
-`SCW_DEFAULT_ORGANIZATION_ID`: your Organization ID.
47
+
-`SCW_DEFAULT_REGION`: concerned region.
49
48
50
-
For more details about variables used by `cli` please refer to [cli config documentation](https://github.com/scaleway/scaleway-cli/blob/master/docs/commands/config.md).
49
+
For more details about variables used by `cli`, please refer to the[cli config documentation](https://github.com/scaleway/scaleway-cli/blob/master/docs/commands/config.md).
51
50
52
-
9. In **Execution** tab, define desired command `/scw block snapshot create volume-id=11111111-1111-1111-1111-111111111111` (replace the ID with your desired volume ID).
51
+
9. In the **Execution** tab, define the desired command:`/scw block snapshot create volume-id=11111111-1111-1111-1111-111111111111` (replace the ID with your desired volume ID).
53
52
54
53
10. Click **Create job**.
55
54
56
55
## Running the job
57
56
58
-
From the **Overview** tab of the Serverless job you just created, click,**Actions**, then select **Run job** from the contextual menu.
57
+
From the **Overview** tab of the Serverless job you just created, click **Actions**, then select **Run job** from the contextual menu.
59
58
60
59
The execution appears in the **Job runs** section. You can access the logs of your job by clicking <Iconname="more" /> next to the job run ID, and selecting **See on Cockpit**.
61
60
62
61
## Possible improvements
63
62
64
63
This tutorial is a lightweight example of how to create recurring snapshots of an Instance. You can go further by:
65
-
- Using it to manage all your Instances snapshots
66
-
-Create backups of your storage disks
67
-
-Set up an alerting system in case of unexpected behavior
64
+
- Using it to manage all your Instances' snapshots.
65
+
-Creating backups of your storage disks.
66
+
-Setting up an alerting system in case of unexpected behavior.
68
67
69
68
## Additional resources
70
69
71
-
-[Serverless Jobs Documentation](/serverless-jobs/how-to/create-job/)
72
-
-[Other methods to deploy Jobs](/serverless-jobs/reference-content/deploy-job/)
0 commit comments