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.
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)- B95% (18)
- C5% (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.
The `find` command with `-delete` removes files; it does not return them or list them as the primary action.
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.
The script itself performs the deletion; it does not configure the directory for automatic deletion by the file system or another service.
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
Community Discussion
No community discussion yet for this question.