Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write bash script that rotate logs. Do the following: - create a log directory. The directory is an argument to routate the file names -
Write bash script that rotate logs.
Do the following:
- create a log directory. The directory is an argument to routate the file names
- file names in the format .number.log
- if NOT vaild - input parameters such as no inputs, negative number, not a directory and non writable directory. Provide feedback to the user and end the program
- if IS VAILD - Rename all files with name (e.g. -3 will rename all files to .3.log). Delete all files with number higher than 5
Make sure its a simple script
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started