Click to See Complete Forum and Search --> : Ican't figure out what this program does!!!


akshay
08-30-2002, 11:16 PM
Hey guys......

i need a real quick help here i have this shell script which does the back up of sql files but i can't understand how the program runs. Can anyone please help me and explain briefly what each line does in the program....

I was able to understand a few lines but rest i can't i am very new to linux and shell script and want to learn it....i hope there is somebody out there to help me... :0)

Thankyou very much.

bastard23
09-03-2002, 01:09 PM
akshay,
A line by line description is a bit much, so I'm going to give some links to bash(and sh) info instead.

Advanced Bash-Scripting Guide (http://www.tldp.org/LDP/abs/html/) which has a fairly good intro to shell scripting.
Bash Reference manual (http://www.gnu.org/manual/bash/index.html)
Bourne Shell Programming (http://steve-parker.org/sh/sh.shtml) A Bourne shell tutorial as the script doesn't seem (on quick perusual) to be doing anything bash specific.

If you already have some programming experience, it should be easy to pick up the basics of the script once you get the syntax. If you have any specific questions, I'll give it a go.

Good Luck,
chris
P.S. I hope this isn't school work.

Stuka
09-03-2002, 02:14 PM
I won't give you a line-by-line either, but it's a fairly simple process in general. The first section creates a directory for the backups (if it's not there already) and tests to make sure it worked. The second part is for 'log rotation' - it moves/deletes (I was skimming) last weeks files every Sunday, and makes room for the new ones. The last section actually performs the dumping of the database.