Question: Write a Linux shell script that performs the following tasks: a. Capture the current date/time and append this information in a file named file
Write a Linux shell script that performs the following tasks: a. Capture the current date/time and append this information in a file named file 1.txt. b. Capture the list of users currently logged into the Linux system and append this data into file1.txt. Write another shell script to perform the following tasks: a. Create a directory name temp 1. b. Copy the file1.txt to temp 1 folder and rename the copied file as file1.bak. Use crontab to schedule the first shell script above to be executes every minute. Next add another task of executing the second shell script at a specific time of the day. Finally, add a third task in the crontab to shutdown the Linux system at 12 midnight. Provide the shell scripts along with the sample output screenshot. Include as well as the details of your crontab to show the schedule of the above THREE (3) tasks to be executed.
Step by Step Solution
There are 3 Steps involved in it
Here are the two shell scripts and the crontab configuration to perform the tasks you described Shel... View full answer
Get step-by-step solutions from verified subject matter experts
