# Ran “update oc\_jobs set last\_run=0” to database

**URL:** <https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452>\
**Category:** ℹ️ Support\
**Tags:** snap, nextcloud\
**Created:** [March 27, 2024, 12:28am UTC](https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452 "2024-03-27T00:28:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![duiveldoder](https://help.nextcloud.com/user_avatar/help.nextcloud.com/duiveldoder/32/60169_2.png) [@duiveldoder](https://help.nextcloud.com/u/duiveldoder)\
**Post date:** [March 27, 2024, 12:28am UTC](https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452/1 "2024-03-27T00:28:13Z")

</div>

Ran “update oc\_jobs set last\_run=0” to database

This is a step in another post which sadly is already closed:

> [@Issue with Automatic Deletion of Files from Trashbin in Nextcloud Snap](https://help.nextcloud.com/t/issue-with-automatic-deletion-of-files-from-trashbin-in-nextcloud-snap/180068/3):
>
> After waiting some time (with the changes to config.php), it seems to be working now.

How exactly do I “run to database” can someone explain a step by step solution how to do this?

if I run “update oc\_jobs set last\_run=0” in the main linux shell I just get an answer the command is unknown, clearly I need to do “to database” whatever that means.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![Dilute8788](https://help.nextcloud.com/letter_avatar/dilute8788/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dilute8788](https://help.nextcloud.com/u/Dilute8788)\
**Post date:** [March 27, 2024, 1:08am UTC](https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452/2 "2024-03-27T01:08:53Z")

</div>

I’m a little new to to this too and I recently moved from nextcloud snap to AIO but per the [nextcloud snap github](https://github.com/nextcloud-snap/nextcloud-snap?tab=readme-ov-file#included-cli-utilities) I believe you just need to type

`sudo nextcloud.mysql-client`

this should open a new MySQL/MariaDB prompt. You may then need to select the nextcloud database which I believe should just be “nextcloud” by default, so type:

`USE nextcloud;`

You should receive a message saying `Database changed` if successful. Now you should be able to run the update query:

`UPDATE oc_jobs SET last_run = 0;`

If you like, you can run a query to select the `last_run` column from the `oc_jobs` table:

```auto
SELECT job_id, class, last_run FROM oc_jobs;

```

This will display a list of jobs with their `job_id`, `class` (which specifies the task the job is responsible for), and `last_run`. The `last_run` column should now show a `0` for all jobs if your previous `UPDATE` command was successful. And then to exit type

`EXIT;`

---

<div class="post-metadata">

**Author:** ![duiveldoder](https://help.nextcloud.com/user_avatar/help.nextcloud.com/duiveldoder/32/60169_2.png) [@duiveldoder](https://help.nextcloud.com/u/duiveldoder)\
**Post date:** [March 27, 2024, 1:18am UTC](https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452/3 "2024-03-27T01:18:05Z")

</div>

> [@Dilute8788](#):
>
> `SELECT job_id, class, last_run FROM oc_jobs;`

one little sidenote to this answer.

it’s not “job\_id” but simply “id” for the SELECT command

Anyway, dear Dilute, thank you SOOOOO MUCH!! You’re a life-saver hehe

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [April 4, 2024, 1:18am UTC](https://help.nextcloud.com/t/ran-update-oc-jobs-set-last-run-0-to-database/186452/4 "2024-04-04T01:18:47Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
