Custom Crons Directory

From WHMCS Documentation

The crons folder may be moved to any place above or below the docroot.

We recommend moving it to a non-public directory above your web root to prevent web based access.

The files within the crons directory need to know where to find your WHMCS installation, and your WHMCS installation needs to know where to find the crons directory, so the relocation process involves editing two files.

1. Begin by choosing a new location for your crons directory and move the entire /crons/ folder and contents to it.

2. Open the config.php file within the crons directory and follow the instructions within it to uncomment the WHMCS path line and provide the full path to your WHMCS installation. For example:

$whmcspath = '/home/username/public_html/whmcs/';

The above example assumes cPanel is being used, where "username" is the account username and "whmcs" is the directory containing the WHMCS installation.

REMEMBER: If you move the crons directory, when you upgrade WHMCS in future, you will need to update the cron files in your custom folder location and not upload the cron files to the default crons sub-directory or you will lose the benefits of moving them.

3. Open the configuration.php file within your WHMCS installation root directory and add the following line to the bottom of the file so that WHMCS is able to locate your custom crons directory location and show you the correct paths you need to use for cron and piping command configuration within the admin interface.

$crons_dir = '/home/username/whmcs_crons/';

The above example assumes cPanel is being used, where "username" is the account username and "whmcs_crons" is the custom crons directory.

If you have existing Cron Tasks configured before you make this change, you will need to update those to use the new directory path following making these changes.