---
title: "CRONJOBS CRITICAL - Housekeeping cronjob has not successfully run for ... hours"
description: "The Opsview Housekeeping Cronjob Monitor service check goes critical if the housekeeping cronjob timestamp is outdated. Fixing permissions errors in backup directories allows the cronjob to complete and updates the timestamp, resolving the critical alert."
url: "https://docs.itrsgroup.com/docs/faq/opsview/4922597158557-opsview-cronjobs-critical-housekeeping-cronjob-has-not-successfully-run-for-hours/index.html"
---
The `Opsview - Housekeeping - Cronjob Monitor` service check looks at the timestamp of `/opt/opsview/coreutils/var/opsview_cronjobs.stat` and, if the timestamp is old, goes critical. The timestamp of this file is updated at the end of a successful housekeeping cron job. Something prevented the timestamp updating when the housekeeping cron job last ran.

This is usually caused by a permissions error under `/opt/opsview/var/backups/` or `/opt/opsview/coreutils/var/backups/`. The permissions error prevents the housekeeping cron job completing successfully so the timestamp of `opsview_cronjobs.stat`is not updated. We typically see this on systems that have been upgraded from Opsview 5.4.

## Solution

1. Log in to the orchestrator as `root`.
2. Check for `Permission denied` errors in the `opsview_cronjobs.log` file:

```
grep -i "permission denied" /opt/opsview/coreutils/var/log/opsview_cronjobs.log
```

Here is an example of a typical permissions error:

```
Removing files from /opt/opsview/coreutils//var/backups over 30 days old:
find: ‘/opt/opsview/coreutils//var/backups/sw-migration/etc’: Permission denied
```

If you see `Permission denied` errors, continue to the next step. If you do not see any such errors, examine the `/opt/opsview/coreutils/var/log/opsview_cronjobs.log` file for other errors and contact support.

3. Fix the permissions using `chown`:

```
chown opsview:opsview /opt/opsview/var/backups/* /opt/opsview/coreutils/var/backups/*
```

4. Wait for the housekeeping cronjob to run normally. The timestamp of the `opsview_cronjobs.stat` file should update when the housekeeping cron job completes successfully. After the timestamp updates, the `Opsview - Housekeeping - Cronjob Monitor` service check should go OK.


