Chapter 24. 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, became frustrated, and called my Arista sales engineer, who asked, “Why not just use schedule?”

Schedule is a feature that’s been around since version 4.5 of EOS that allows the regular scheduling of commands. The cool part of this feature is that it’s completely configured from the command-line interface (CLI), so you don’t need to spend any time swearing at cron. In this chapter, we 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
  config  Set CLI scheduler configuration parameters

The only configuration options as of EOS 4.21.1F are max-concurrent-jobs, which you can set from 1 to 4, with the default being 1, and prepend-hostname-logfile, which does exactly what it sounds like it does and is now the default behavior:

Arista(config)#schedule config max-concurrent-jobs ?
  <1-4>  Maximum number of concurrent jobs

To create a scheduled job, you first must specify a name for the job. Because I’m the writer and I ...

Get Arista Warrior, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.