Cron Job

To ensure that expired short links are cleaned up from the JSON file in ShrtUrl, a cron job needs to be set up to run the cron.php file once a day. Follow the steps below to set up the cron job:

  1. Log in to the ShrtUrl admin panel using your admin credentials.

  2. Click on the "Cron Job" link in the navigation bar to access the Cron Job page.

  3. Here, you can view the command that should be used for the cron job. An example command is:

    0 0 * * * php /path/to/shrturl/class/cron.php > /dev/null 2>&1

    Copy this command.

  4. Use the command to set up a cron job on your web hosting control panel to run cron.php every day at midnight.

  5. Log in to your web hosting control panel.

  6. Navigate to the "Cron Jobs" or "Scheduled Tasks" section.

  7. Click on "Add New Cron Job" or "Create New Scheduled Task".

  8. Paste the command you copied earlier.

  9. Click on the "Save" or "Add" button to create the cron job.

Once these steps are completed, the cron.php file will be run automatically every day at midnight, and expired short links will be removed from the JSON file.

Last updated