0

As in subject, I want make bash script that will check the time, and when it is between 04:00-05:00 in night, it will execute one command.

Can someone help me?

irondew
  • 9
  • 3

1 Answers1

1

The best way to schedule an event is using crontab.

For example, below crontab syntax will schedule to execute your script foo.sh at 04:00 AM daily.

0 4 * * * /bin/foo.sh 
mainframer
  • 20,411
  • 12
  • 49
  • 68