I did some research and found this:
And both columns coresponds to when I created the product, and when I updated it. - So we can use the updated_at column
And in table catalog_product_enabled_index we delete the product_id then it will not be shown on store
The sql will look somethink like this:
`catalog_product_entity`.`sku` as sku
`catalog_product_entity`.`updated_at` < DATE_SUB(NOW(), INTERVAL 35 DAY)
This will show SKU for products not updated for last 35 days.
This SQL is intended for use in an import file, so you can change the status of these SKU.
I will suggest that you make some sort of attribute fx. expired (yes/no) and sets is_active to no and expired to no.
When you import this expired sku list, you will touch the timestamp of updated_at and therefore you have to use the expired attribute in the SQL too. I will update this later with the correct SQL line.
How do I make a cron job for this ?