# How Cron Works

## Cron.php

Cron.php is the main file that is in the folder. it runs every other php file in result running all of the php files in the folder simultaneously. ![Cron.php code](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-cbae0c843d5f9141412cf0f946472629463d0fa4%2FCronphp.png?alt=media)

## autoban.php

Since i already coversed it in a different post, i will just link you there.

* [How Autoban works](https://gdpsfh.gitbook.io/community-guide/backend/how-autoban-php-works)

## fixnames.php

It really only fixes the username in the accounts section in the sql server to the usernames in the user section. ![fixnames.php code](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-a08fdc0724e71609572771e7e1d0215c81ca1676%2Ffixnamesphp.png?alt=media)

## SongCount.php

This file updates the amunt of levels use the song in the sql server. There isnt much else to say about this one. ![SongCount.php Code](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-ebbec83010cb19db0db13c94bfd342570db48f02%2Fsongcountphp.png?alt=media)

## fixcps.php

this is one of the longer ones.

it first of all checks if there is a log file in the tools directory. if there is, it will check when it was created and see if was before the cooldown end. if it does the code will exit saying:

```php
	exit("Please wait $remainmins minutes and $remainsecs seconds before running ". basename($_SERVER['SCRIPT_NAME'])." again");
```

![first part](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-7649c3e5407313c0a118c334477729c7a7fe22b5%2Ffixcpserror_reportig.png?alt=media)

if the cooldown expired already, it include the connection.php file and start getting the users. ![second part](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-29e7e5b97daa0fd8354159fea1ad2b442bd23c54%2Ffixcps_getting_users.png?alt=media)

### CP SHARING

the code will now check the levels to see if the level has IsCPShared = 1 if its a yes, it will give both users a creator point each, also dependent if the level is star, featured or epiced. ![third part](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-f4b9d5b8b549ce67bd783dd1790a991c56a1aede%2Ffixcps_CP_SHARING.png?alt=media)

### DAILY LEVEL CP

the code at this part is going to slelect the ID's from daily features and will give the creator of the level some creator points. ![cp distrobution daily](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-9b2cff54f56e5002da7b46bcc3ca482f192917de%2Ffixcps_DAILY_CP.png?alt=media)

### DONE

the code finally finishes calculating everything and will give all of the users the specified creator point the code calculated. ![fixcps done](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-936a4a5d21646d0ed9510517c4ceb2e1e7d033ab%2Ffixcps_DONE.png?alt=media)

were finally done with Fix CP.

## removeBlankLevels.php

simply removes invalid users, songs, fixes invalid passwords and removes songs with nonsensical URL's. Although no mention of deleting blank level as to the name. ![removeblank](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-c926a6fdf184a2a6510a290283147704f81e6ff2%2Fremoveblank.png?alt=media)

## Friendsleaderboard.php

Simply updates the friends leaderboard for people. ![friendslead](https://3430520752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDN9n70KVji27yKpfd18%2Fuploads%2Fgit-blob-2586d966d3a8fa16ca3ce3078142dcca485f60c6%2Ffriendsleaderboard.png?alt=media)


---

# Agent Instructions: 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://gdpsfh.gitbook.io/community-guide/backend/how-cron-works.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.
