nerdexam
Cisco

200-901 · Question #332

Refer to the exhibit. An engineer is managing the network of an enterprise. The network is using a distributed deployment model. The enterprise uses database to store logs. The current policy…

The correct answer is B. deleting backup files that are older than 30 days. The Bash script uses the find command with mtime +30 and -delete options to remove log files older than 30 days from a specified backup directory.

Infrastructure and Automation

Question

Refer to the exhibit. An engineer is managing the network of an enterprise. The network is using a distributed deployment model. The enterprise uses database to store logs. The current policy requires logs to be stored if changes are made to the infrastructure in any of the devices on the data centers. Which workflow is being automated by the Bash script?

Options

  • Areturning backup files that are older than 30 days
  • Bdeleting backup files that are older than 30 days
  • Cconfiguring the directory to delete files automatically
  • Dautomating deletion of all backup files every 30 days

How the community answered

(19 responses)
  • B
    95% (18)
  • C
    5% (1)

Why each option

The Bash script uses the `find` command with `mtime +30` and `-delete` options to remove log files older than 30 days from a specified backup directory.

Areturning backup files that are older than 30 days

The `find` command with `-delete` removes files; it does not return them or list them as the primary action.

Bdeleting backup files that are older than 30 daysCorrect

The script uses `find $BACKUP_DIR -type f -name "*.log" -mtime +$MAX_RETENTION_DAYS -delete`. The `-mtime +$MAX_RETENTION_DAYS` (which is +30 days) option filters files modified more than 30 days ago, and the `-delete` action explicitly removes these found files.

Cconfiguring the directory to delete files automatically

The script itself performs the deletion; it does not configure the directory for automatic deletion by the file system or another service.

Dautomating deletion of all backup files every 30 days

The script deletes files older than 30 days, not all backup files every 30 days.

Concept tested: Bash script for file management (find command)

Source: https://man7.org/linux/man-pages/man1/find.1.html

Topics

#Bash scripting#Automation workflows#File management#Data retention

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice