LPIC-1 Shells, Scripting and Data Management • Complete Question Bank
Complete LPIC-1 Shells, Scripting and Data Management question bank — all 0 questions with answers and detailed explanations.
A systems administrator is responsible for a Linux server that runs a custom application. The application writes logs to /var/log/app.log and rotates them using logrotate. Recently, the server ran out of disk space because log files were not being rotated. The administrator checks the logrotate configuration file /etc/logrotate.d/app and finds:
/var/log/app.log { weekly rotate 4 compress missingok notifempty
}
The administrator manually runs 'logrotate -f /etc/logrotate.d/app' and the log rotates successfully. However, the next day, the log is not rotated again. The administrator checks the cron job for logrotate and finds that /etc/cron.daily/logrotate exists and runs logrotate /etc/logrotate.conf. The administrator checks /etc/logrotate.conf and sees that it includes /etc/logrotate.d/*. What is the most likely reason the log is not rotating automatically?
Refer to the exhibit. $ ls -l /usr/local/bin/myapp -rwxr-xr-x 1 root root 12345 Jan 1 12:00 /usr/local/bin/myapp $ file /usr/local/bin/myapp /usr/local/bin/myapp: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped $ ldd /usr/local/bin/myapp linux-vdso.so.1 (0x00007ffe5a3b0000) libc.so.6 => /lib64/libc.so.6 (0x00007f9a8b200000) /lib64/ld-linux-x86-64.so.2 (0x00007f9a8b600000)
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Debian, Ubuntu
RHEL, CentOS 7
Fedora, RHEL 8+
openSUSE
Arch Linux
The output of 'set | grep -i path' returns: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Consider the following script named 'parse.sh': #!/bin/bash while IFS=',' read -r field1 field2 remainder; do echo "$field1 $field2" done < input.txt Assume input.txt contains: a,b,c d,e,f
The output of 'cat /etc/crontab' shows: * * * * * root /usr/local/bin/backup.sh
command 2>&1 > output.txt
{
"allow": [{"action": "execute", "path": "/usr/bin/*"}],
"deny": [{"action": "execute", "path": "/usr/bin/passwd"}]
}$ set | grep -E ^BASH BASH=/bin/bash BASH_ALIASES=() BASH_CMDS=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSION='5.0.0(1)-release'
./script.sh: line 3: $'\r': command not found