@Pedro-Kerche
would you teach me how to create this cronjob. the command line to create this automation
Please follow the below steps for running the cronjob clear cache:
Step 1: Open your terminal with your project root directory
Step 2: Now you will run the below command in project root directory:
$ crontab -e
cc0e2235-3298-48ca-93fd-2841a2e20863-image.png
After edit your crontab save and close the crontab for now (CTRL + X, CTRL + Y, then ENTER if you selected nano).
Step 3. Now check your view the contents of your crontab, but not edit it, you can use the following command:
$ crontab -l
9abbeb14-b027-436b-ab11-4d6bc1167c13-image.png
Step 4: Now check the setup is correct or not, so you will run the showing file path command till end in your crontab terminal check the below screenshot:
6cb5f69e-97a2-4ea0-8f0e-2ea087e5f3e0-image.png
Note:
If you are not showing like this, so you will followed the below steps:
Go to the project root directory with you want to delete the folder path, and check the current directory of your project folder, run the below command:
pwd
It will show the current project file path.
Once again check this is working or not, please follow the above 4 step again. You will run the showing file path command till end in your crontab terminal.
Now your crontab is saved, and project folder removed in every 2 days.
Also, you can check the below links for more information:
https://stackoverflow.com/questions/16325350/setting-cron-job-to-delete-file-after-24-hours