0
votes
1answer
133 views

Creating MySQL database and user without password

I am building a set of bash scripts which basically prepare apache virtual hosts, git repositories and other stuff on a cloud server. So far so good, everything is working, but a big problem occurred: ...
0
votes
1answer
258 views

Can someone provide an xargs example piping mysql query data into another command?

Can someone provide an example for the command xargs? I want to do a mysql query to return the ID field of a column then feed that result into xargs into another command say mysql query delete. How ...
0
votes
3answers
702 views

How to create an interactive bash script to collect arguments for a command in linux?

I'm trying to create an interactive bash script where I can collect user input variables to be used as arguments in another command. Can someone provide me an example of this? Currently i want to do: ...
4
votes
4answers
4k views

How can I check if mysql is installed using a bash script?

I need to check if mysql is installed from within a bash script. What would be an efficient way of doing that? I thought I could do this: if [ ! -f `which mysql` ] ; then echo "foo" fi But I ...
0
votes
1answer
186 views

How to use a password as an external variable in shell?

I have this MySQL backup script that I use to back up MySQL databases. Very useful, and it runs on fixed intervals using a cron. However, I need somehow provide this script with the MySQL password. ...
2
votes
1answer
673 views

How to script a database migration using SSH?

I am trying to create a sync.sh script that coordinates with our less-than-ideal version control for our website. This script will migrate a copy of the live database to our local development ...
2
votes
2answers
216 views

List files that occur lexically after/greater than a given prefix (or, run database upgrade scripts in a proper order)

I'm trying to create a shell script that runs through a bunch of SQL scripts. I've these files: $ ls upgrade/ 01-foo.sql 02-bar.sql 02-baz.sql 03-foo1.sql 04-buz.sql And I've got the version of ...
1
vote
1answer
315 views

How to install a database dump via Shell Script?

I have a Mysql database dump. I want to install it with Hudson via a Shell Script to an external Linux machine. How can you take a Mysql script and run it inside a database on other machine? I know I ...
0
votes
1answer
431 views

How to write script for automatic joomla installation in webhost

I want to create a script in Linux that automatically downloads the latest Joomla from their website and then installs it to the specified user. Is it possible in a shell script? I don't know how it ...