I have to write a shell script like this--
1) Utility will be run under the directory owner.
2) This utility will clean files in ABC/logs. And following logs will be backed up or deleted.
Dispatcher Logs
Middle tier Logs
Sage log
Sage monitor log
Sage db clean up result log
Core files
3) mt_clean -a<action> [-t <time>]* -L <backup location>
-a<action> - has two values "delete" or "backup”. If not specified by default "delete" action will*occur. If*"backup" option is given, files will be backed up on the location specified by the -L, -L is mandatory if back up option is specified.
-t<time>* - The time is given with the -t option and its default is 1am
A time of 'now' means to execute the cleanup operation now
A time of 'never' means that the cleanup operation should not be scheduled and any existing cleanup should be cancelled.
-L <backup location> -*this field is mandatory if backup action is selected.
Note: As middle tier process are running and not stopped while this utility is running, the utility should create an empty*file with same name which has deleted or backed up. Otherwise middle tier logs will not be generated until the middle tier process is restarted. Any core files will be backed up or deleted according to the action chosen.*
Note-> mt_clean is the utility name.it can be run like this.
mt_clean -a delete/backup now somelocation.
it will take the backup or delete the log files now only or if backup needed it will do it in backuplocation.
If i can clarify any doubt please let me know.
i will appericiateur help.
I have to use getopts in this,i am a newbie in shell scripting and learning it.