That 5 can be any number:
for n in {0..1440..5}; do date -u --date="$n minutes ago"; done
题
Currently, I'm trying to use the date
command (NOT crontab) to manually download a file that is uploaded to a server every five minutes.
I realize that date -u +%M --date="5 minutes ago"
will display the time from 5 minutes ago but, I'm looking for a way to go back in 5 minute increments.
解决方案
That 5 can be any number:
for n in {0..1440..5}; do date -u --date="$n minutes ago"; done