Pretty much struggling with this one question and wondering if you guys can help me
Basically this question has me stumped, i dont even know how i should document it
maybe you guys can help me figure it out... Im pretty good on Linux but with it being almost 12 and me not sleeping for a few days i cant get my head round it!!!!
Question 3: UNIX Programming (This must be implemented using a UNIX System)
A Generational Log File System. Many UNIX servers maintain log files in which they write data about operations they perform and their success or failure. Log Data can then be used later on to analyse security problems, but these log files tend to grow and unless regularly truncated, can fill up the disc.
The aim of this coursework is to create a generational log (e.g. daily log) for say three days, with suffix .1, .2, .3 for example. The last copy of the log is then erased automatically.
Write a function named ‘rotate’ that takes a file name and a number of old copies to maintain as its parameters. This function will then carry out the appropriate file renaming. Log files will then be written to the logs directory.
(Suggestion: use a shorter time period than one day for demonstration purposes). Hand in the script and sample log files.
Basically this question has me stumped, i dont even know how i should document it
maybe you guys can help me figure it out... Im pretty good on Linux but with it being almost 12 and me not sleeping for a few days i cant get my head round it!!!!
Question 3: UNIX Programming (This must be implemented using a UNIX System)
A Generational Log File System. Many UNIX servers maintain log files in which they write data about operations they perform and their success or failure. Log Data can then be used later on to analyse security problems, but these log files tend to grow and unless regularly truncated, can fill up the disc.
The aim of this coursework is to create a generational log (e.g. daily log) for say three days, with suffix .1, .2, .3 for example. The last copy of the log is then erased automatically.
Write a function named ‘rotate’ that takes a file name and a number of old copies to maintain as its parameters. This function will then carry out the appropriate file renaming. Log files will then be written to the logs directory.
(Suggestion: use a shorter time period than one day for demonstration purposes). Hand in the script and sample log files.