سؤال

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
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top