I'm on debian. I would like to execute an apt-get update (and maybe something else) only if the time since last update is bigger or smaller than a certain amount with a straight command, no cron tricks or similar.
Let's assume I know nothing about apt-get previous state, an update could have been never issued since the os installation, or triggered manually 2 mins ago, or issued automatically by unattended-upgrades service.
if(time > 30 min) apt-get update if(time > 2 days) something else
This question is similar to another I found in askubuntu but due the different setup in debian config I can't find a timestamp file informing me when the last update command took place.