You shouldn't be calling fsck on a booted system, yes, especially not fsck -A. If you're lucky it will refuse to do anything, if you're not, you could mess up your system.
You shouldn't be using * on something that could have lots of files.
You don't need to reopen $log 9,000 times to print 9,000 times. Open it once, and print to it.
Use printf, not "echo -e", as echo -e is not portable. Note that printf needs you to specify \n on the end when you want them.
Run date once and save it in a variable, or else the date might just change halfway through the script on an unlucky midnight.
Check the return values of things. Your script at present won't have any idea whether it succeeded or failed. Your script returns success even when it knows it failed, too.
And instead of nesting your if-statements, you should quit immediately. That way you can just list conditions to quit on instead of nesting 9 deep when checking 9 things.
If you want tar to make a tar.gz, you have to give it -z as well.
The "cd" is pointless since you're giving tar absolute paths anyway, you can remove it.
Note that pasting these together won't give you a complete script, I'm commenting on bits and pieces and advising what to change.
Hello all,
I have a quick question for those that might know,
Would a degree in Computer and Information Science (CIS) be enough to get in the Unix Systems Administration door at the junior level? Or is Computer Science a better choice.
The reason I ask is because a degree in CIS is the only... (8 Replies)
I am researching the reasons why Unix / Linux is the chosen operating system versus Windows. I have had difficutly narrowing down resources. I am wondering if anyone has any favorite sources that they would care to share.
Thanks
Dan (2 Replies)
Hi,
i have a client requirement to post the files into generic folder named as "source".file identification is to retrieve Publication code (Instance name) from the file name.So thereafter we move the files to different instances of specific folders for the same unix server.(means if the file... (2 Replies)
Hi all,
I have two files in my folder
1.index.jsp
2.maintenance.jsp
Once hit the URL in IE,It will call the index.jsp file than application working fine.
I want to some maintenance in my application, during the application maintenance than it will... (1 Reply)
Here's the assignment. I'll bold the parts that are rough for me. Unfortunately, that's quite a bit lol. The syntax is, of course, where my issues lie, for the most part. I don't have a lot of programming experience at all :/. I'd post what I've already done, but I'm so lost I really don't know... (1 Reply)