The Scheduler will execute:
The Ads (Listings) Clear command (that auto archives and deletes ads after expiration) every hour.
The Cache and Views Clear commands, the latest day of every week at 6:00.
When using the scheduler, you only need to add the following Cron entry to your server.
* * * * * {PHP_BIN_PATH} /path/to/public_html/artisan schedule:run >> /dev/null 2>&1This Cron will call the Laravel command scheduler every minute. When the schedule:run command is executed, Laravel will evaluate your scheduled tasks and runs the tasks that are due.
NOTE
{PHP_BIN_PATH} => Examples: /usr/bin/php8.2 or /usr/bin/php or /usr/lib/php, ...
/path/to/public_html/ => You need to replace this path by your server's real public root path.
Don't hesitate to ask more information about it from your hosting provider.
You can disable the Auto Cache and Views Clear command by adding this variable: DISABLE_CACHE_AUTO_CLEAR=1 in the /.env file.
More information about Cron Job:
https://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs–net-8800
http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
After setting it up to run every hour (for example), you can consider 2 cases:
You have to set up the options below from the Admin panel → Settings → General → Cron:
Unactivated Ads/Listings Expiration: After this time (in days) the unactivated ads/listings will be deleted
Activated Ads/Listings Expiration: After this time (in days) the activated ads/listings will be archived
Archived Ads/Listings Expiration: After this time (in days) the archived ads/listings will be removed
Manually Archived Ads/Listings Expiration: After this time (in days) the manually archived ads/listings will be removed
After the Packages duration time (in days) that you have set up from the Admin panel -> Settings -> Packages -> [EDIT] -> Duration, the Premium Ads/Listings become Regular Ads/Listings.
NOTE:
The expiration duration of free packages (ie packages with 0 as price) will not be taken to account. The Regular Ads rules will be take to account instead.
For site owners that have installed our Offline Payment plugin, pushed ads as premium (ie manual promotions of ads from the admin panel) will never expire. You will need to un-feature them (ie remove the promotion manually) first.
And then, the Regular Ads rules (seen in #1) are applied to clear the website database.