A Linux administrator would like to run the cleanup script /home/admin/script.sh at 9:00 p.m. on March 31. Which of the following commands should the administrator use to accomplish this task?
D. according to this site, we can also run scheduled tasks by passing a shell script file to the at command using the -f option.
Let’s run a file at 00:00 (midnight):
$ at 00:00 -f /home/ubuntu/file.sh
https://www.baeldung.com/linux/at-command
at [TIME] [DATE]
A. -f is not a valid option for the at command
B. echo < /home/admin/script.sh | at 9pm March 31 -- reading from the source and pipe it down the at command, make sense.
C. does not work (you are writing into the source).
D. same as A, -f is not a valid flag
I tested all four. A ran reliably (I used a bash script to output some text with the time of exection to a text file). B, C, and D produced no output to the text file. C and D did not work as one-liners (the command would be `at 9pm March 31` and it puts you at the at> prompt. Adding the remainer of the commands did not result in any output to the text file
the answers ABD are correct, perhaps because I am using lastest versions of Ubuntu and CentOS, but I will stick with the option B, very confusing tbh
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
lexdaniel
1 week, 1 day agoNastyNutsu
3 weeks, 4 days agojimr999
1 month, 2 weeks agoBull88
2 months, 1 week ago