Chapter 23. Scheduler

I was working in a data center, building out an Arista network, when I decided that I wanted to automate a command that should run every five minutes. Knowing that these super cool Arista switches run Linux, I dropped into bash and proceeded to muck around with cron. I couldn’t get it to work, got frustrated, and called my Arista sales engineer who asked, “Why not just use schedule?”

Schedule is a feature introduced in EOS 4.8 that allows the regular scheduling of commands. The cool part of this feature is that it’s completely configured from CLI. Let’s take a look at this powerful tool.

The schedule command is the root of just about everything we’re going to do in this chapter. It’s simple to use, and the question mark along with tab completion will get you most of what you want to know about its function:

Arista(config)#schedule ?
  WORD  Scheduled job name

To create a scheduled job, you must first specify a name for the job. Since I’m the writer, I’ll use the name GAD for my job:

Arista(config)#schedule GAD ?
  interval  Set interval for CLI command execution

The interval is the amount of time in minutes to wait between each iteration of the job. If you want the job to run every five minutes, the interval would be five. In version 4.9.3, acceptable values range from 1 to 1,440:

Arista(config)#schedule GAD interval ?
  <1-1440>  Interval in minutes for CLI command execution

The next thing I need to specify is the maximum number of logfiles that will be retained. Every time ...

Get Arista Warrior now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.