Scheduling automatic backups using the CLI

Prev Next

Use the commands in this section to schedule automatic backups for the database.

To configure the scheduled backup job:
  1. Go to CLI configuration mode:

    hostname > enable
    hostname # configure terminal
  2. Create the job by specifying the job ID.

    hostname (config) # job <jobID>

    Note

    To delete a job, use no job <jobID>.

  3. Specify the sequence number for the scheduled backup job.

    hostname (config) # job <jobID> command <sequenceNumber>
  4. Use the backup profile command to specify the type of profile.

    hostname (config) # job <jobID> command <sequenceNumber> "backup profile <profile>"
    • To schedule the backup job for the configuration database:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile config"
    • To schedule the backup job for the Trellix appliance:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile fedb"
    • To schedule the backup job for both the configuration database and the Trellix appliance:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile config+fedb"
    • To schedule the backup job for the configuration database, Trellix appliance database, and detected data (malware, alerts, reports, and so on):

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile full"
  5. Use the backup profile command to specify the location for the backup file.

    hostname (config) # job <jobID> command <sequenceNumber> "backup profile <profile> to <backupLocation>"
    • To schedule the backup job to a local destination on the appliance:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile <profile> to local"
    • To schedule the backup job on a remote server:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile <profile> to <url>"

      where <url> is the specified remote location using the following format:

      scp://<username>:<password>@<hostname>/<remotePath>
    • To schedule the backup job to a USB drive on your local machine:

      hostname (config) # job <jobID> command <sequenceNumber> "backup profile <profile> to usb"
  6. Save your changes:

    hostname (config) # write memory
To schedule automatic backups for the database:
  1. Specify how often you want the backup job to run automatically.

    • To schedule daily, enter the end date, start date, or time:

      hostname (config) # job <jobID> schedule daily end date <yyyy/mm/dd>
      hostname (config) # job <jobID> schedule daily start date <yyyy/mm/dd>
      hostname (config) # job <jobID> schedule daily time <hh:mm:ss>

      The parameter values are as follows:

      • <yyyy/mm/dd> specifies the end or start date for the backup job.

      • <hh:mm:ss> specifies the time to start the backup job based on a 24-hour clock.

    • To schedule monthly, enter:

      hostname (config) # job <jobID> schedule monthly day-of-month <day>

      where <day> is the day of the month the backup should occur.

    • To schedule once, enter:

      hostname (config) # job <jobID> schedule once time <hh:mm:ss> date <yyyy/mm/dd>

      The parameter values are as follows:

      • <hh:mm:ss> specifies the time to start the backup job based on a 24-hour clock.

      • <yyyy/mm/dd> specifies the date to start the backup job.

    • To schedule a backup that runs periodically on a schedule you define, enter the end and start date or time interval:

      hostname (config) # job <jobID> schedule periodic end date <yyyy/mm/dd> time  <hh:mm:ss>
      hostname (config) # job <jobID> schedule periodic start date <yyyy/mm/dd> time  <hh:mm:ss>
      hostname (config) # job <jobID> schedule periodic interval <timeInterval>

      The parameter values are as follows:

      • <yyyy/mm/dd> specifies the end or start date for the backup job.

      • <hh:mm:ss> specifies the end or start time for the backup job based on a 24-hour clock.

      • <timeInterval> is specified in the format of "2h3m4s."

    • To schedule weekly:

      hostname (config) # job <jobID> schedule <frequency> weekly day-of-week <day>

      The <day> parameter is the day of the week the backup job is scheduled to occur. Valid values are sun (Sunday), mon (Monday), tue (Tuesday), wed (Wednesday), thu (Thursday), fri (Friday), and sat (Saturday).

    • To specify a type of schedule, enter:

      hostname (config) # job <jobID> schedule <type>

      where <type> is the type of schedule for the backup job. Valid values are:

      Value

      Description

      once

      The backup runs only once

      daily

      The backup runs daily

      weekly

      The backup runs weekly

      monthly

      The backup runs monthly

      periodic

      The backup runs automatically on a schedule you define

  2. Enable the configuration for the scheduled backup job.

    hostname (config) # job <jobID> enable

    Note

    To disable a job, use no job <jobID> enable.

  3. Save your changes:

    hostname (config) # write memory
  4. Verify the status for the scheduled backup job. For example:

    hostname (config) # show job
     
    Job 333:
       Status:              pending
       Enabled:             yes
       Continue on failure: no
       Schedule type:       daily
       Time and date:       2016/08/16 00:00:00 +0000
       Last exec time:      N/A
       Next exec time:      Sun 2016/08/17 00:00:00 +0000
       Commands:
          Command 1: backup profile config to local