• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

delete images

sirfpsycho

Chevereto Member
Hello, I want to delete images from my server which are older than 1 year and less than 5 views. How can I do it?
 
Run this in your database:

SQL:
UPDATE `chv_images` SET image_expiration_date_gmt='2021-11-26 00:00:00' WHERE image_views<5 AND image_date_gmt < DATE_SUB(NOW(),INTERVAL 1 YEAR);

That will update the expiration date to today for image views < 5 and older than a year. Once the cron runs, it will be progressively removing all the affected images.
 
Run this in your database:

SQL:
UPDATE `chv_images` SET image_expiration_date_gmt='2021-11-26 00:00:00' WHERE image_views<5 AND image_date_gmt < DATE_SUB(NOW(),INTERVAL 1 YEAR);

That will update the expiration date to today for image views < 5 and older than a year. Once the cron runs, it will be progressively removing all the affected images.
will it remove files from server? or only database will clear? Files are stored on server and I want to delete files from server too.
 
To clarify, the MySQL statement that I gave you will trigger the delete expired images functionality on top of the affected images. When running the Cron, the system will ask for any pending expired images to remove and it will proceed to delete the rows (database) and files (server) from the system.
 
To clarify, the MySQL statement that I gave you will trigger the delete expired images functionality on top of the affected images. When running the Cron, the system will ask for any pending expired images to remove and it will proceed to delete the rows (database) and files (server) from the system.
I ran command in sql and ran the cron but images from server was not deleted. sql command ran successfully.
 
It will take several cron runs to remove all the affected images if the range is too big.
 
Back
Top