The last crontab field accepts a complete standard shell (no bashism), except that a literal % must be escaped \%
The shell allows to group commands for a common redirection:
Code:
*/15 * * * * { date; apt update; date; } > log.file
The following allows the apt to run up to twice the interval time (2*15=30 minutes):
Code:
*/15 * * * * ld=/tmp/mylockdir; if mkdir $ld 2>/dev/null; then apt update; fi; rmdir $ld