> For the complete documentation index, see [llms.txt](https://nk0.gitbook.io/dfir/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nk0.gitbook.io/dfir/linux/forensics/cron-jobs.md).

# Cron Jobs

### Systemwide Cron Locations:

* /etc/cron.d
* /etc/crontab
  * In CentOS, the system crontab. Nowadays the file is empty by default. Originally used to run daily, weekly, etc jobs.
  * In Debian, the system crontab. The content of /etc/crontab is predefined to run programs under /etc/cron.hourly. /etc/cron.daily, etc.
* /etc/cron.hourly
  * Runs scripts hourly
* /etc/cron.daily
  * Runs scripts daily
* /etc/cron.weekly
  * Runs scripts weekly
* /etc/cron.monthly
  * Runs scripts monthly

### User Specific Crontab

* RHEL/CentOS/Fedora
  * /var/spool/cron/USERNAME
  * usernames can be found is /etc/passwd
* Debian Ubuntu
  * var/spool/crcon/crontabs/USERNAME
  * usernames can be found is /etc/passwd

### Cron Access Rules

**Locations:**

* etc/cron.allow
* etc/cron.deny

**Logic:**

* If cron.allow exists - only users listed in cron.allow get access to crontab.
* If cron.allow does not exist - only users not in cron.deny get access to crontab.
* If neither exist - only root gets access to crontab.
* If a user exists in both - that user gets access to cronab.

### Cron Logs

**Locations:**

* var/log/cron
  * Whenever cron daemon (or anacron) starts a cron job, it logs the information about the cron job in this file.

**Cron File Information**

* Stores information about command to be executed and how often.

{% embed url="<https://forensicate.cloud/ws1/Lab14-Identify_Evidence_of_Persistence>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nk0.gitbook.io/dfir/linux/forensics/cron-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
