read variables from file

Posted by TonyVipros on Stack Overflow See other posts from Stack Overflow or by TonyVipros
Published on 2010-05-10T14:56:50Z Indexed on 2010/05/10 15:14 UTC
Read the original article Hit count: 123

Filed under:

Hi,

I'm trying to write a shell script to backup websites, I've got it to go through each directory in vhosts and create a new directory vhosts/{siteurl}/private/backups/ and gzip up the site into there.

However, I also want it to read a file from private that will contain database name, user and password. So I can then use these to perform a mysqldump to private/backups/.

The problem is that I've never written a shell script before so I've go no idea how to read variable data into my script, or how I should format the file to be read.

Hope that's enough information.

© Stack Overflow or respective owner

Related posts about shell-scripting