<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple shell script to backup multiple mysql databases</title>
	<atom:link href="http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases</link>
	<description>get all his digital goodness 24/7</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:05:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-2942</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Fri, 02 Sep 2011 23:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-2942</guid>
		<description>@Martijn
Are you setting up the cron job yourself, or using a hosting provider?

The error simply means it can&#039;t find the script on the path,      $HOME/scripts/daily_sql_backup.sh 

There are a few possible causes:
1) That&#039;s not where you saved the script (try pasting that command directly in the command line, with the full path)
2) The $HOME variable is not set (replace with full /home/myUserName)
3) Your host uses a different user to run the cron jobs, and $HOME is invalid (replace with full /home/myUserName)</description>
		<content:encoded><![CDATA[<p>@Martijn<br />
Are you setting up the cron job yourself, or using a hosting provider?</p>
<p>The error simply means it can&#8217;t find the script on the path,      $HOME/scripts/daily_sql_backup.sh </p>
<p>There are a few possible causes:<br />
1) That&#8217;s not where you saved the script (try pasting that command directly in the command line, with the full path)<br />
2) The $HOME variable is not set (replace with full /home/myUserName)<br />
3) Your host uses a different user to run the cron jobs, and $HOME is invalid (replace with full /home/myUserName)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martijn</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-2939</link>
		<dc:creator>Martijn</dc:creator>
		<pubDate>Tue, 30 Aug 2011 16:48:05 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-2939</guid>
		<description>I´ll get the following error: daily_sql_backup.sh: command not found

any toughts?</description>
		<content:encoded><![CDATA[<p>I´ll get the following error: daily_sql_backup.sh: command not found</p>
<p>any toughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1687</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Mon, 20 Sep 2010 11:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1687</guid>
		<description>@Tom
Thanks! That is a handy trick to backup multiple databases on the same host.

Since I use a few hosts I may tweak that script above to use one master password for each host, and then run through all contained databases. Easy change by wrapping your loop inside a larger loop based on hostnames.
 Fantastic!</description>
		<content:encoded><![CDATA[<p>@Tom<br />
Thanks! That is a handy trick to backup multiple databases on the same host.</p>
<p>Since I use a few hosts I may tweak that script above to use one master password for each host, and then run through all contained databases. Easy change by wrapping your loop inside a larger loop based on hostnames.<br />
 Fantastic!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Coady</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1686</link>
		<dc:creator>Tom Coady</dc:creator>
		<pubDate>Mon, 20 Sep 2010 08:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1686</guid>
		<description>This script has served me well for the last year or more, but when I mentioned that new databases need to be added by hand a learned friend suggested the following:
&lt;code&gt;
for db in $(mysql -e &quot;show databases&quot; -B  --skip-column-names); do
   mysqldump --opt --databases $db &#124; gzip  -3 --rsyncable &gt; /var/backups/$db.sql.gz
done
&lt;/code&gt;
of course you may need to append your host, user &amp; password credentials, depending on your environment.</description>
		<content:encoded><![CDATA[<p>This script has served me well for the last year or more, but when I mentioned that new databases need to be added by hand a learned friend suggested the following:<br />
<code><br />
for db in $(mysql -e "show databases" -B  --skip-column-names); do<br />
   mysqldump --opt --databases $db | gzip  -3 --rsyncable &gt; /var/backups/$db.sql.gz<br />
done<br />
</code><br />
of course you may need to append your host, user &amp; password credentials, depending on your environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacques UWAYO</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1628</link>
		<dc:creator>Jacques UWAYO</dc:creator>
		<pubDate>Fri, 23 Jul 2010 08:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1628</guid>
		<description>hi i made a shell script to dump mysql select result to csv file
the script works very well when i run it manual,but the crontab doesnt run,
it is just creating the empty csv file
below is the file

#!/bin/bash
datetime=`date +&quot;%Y%m%d&quot;`
FILE=&quot;/tmp/mysql_dump/mydumpfile_$datetime.csv&quot;
mysql -uuser -pmypasswor db1 -e &quot;select subtoken MSISDN,state,expiration_date from comp_subscription,comp_subscription_information
where comp_subscription.id=comp_subscription_information.comp_subscription_id
  order by expiration_date&quot; &gt; $FILE


Please advise 
Regards</description>
		<content:encoded><![CDATA[<p>hi i made a shell script to dump mysql select result to csv file<br />
the script works very well when i run it manual,but the crontab doesnt run,<br />
it is just creating the empty csv file<br />
below is the file</p>
<p>#!/bin/bash<br />
datetime=`date +&#8221;%Y%m%d&#8221;`<br />
FILE=&#8221;/tmp/mysql_dump/mydumpfile_$datetime.csv&#8221;<br />
mysql -uuser -pmypasswor db1 -e &#8220;select subtoken MSISDN,state,expiration_date from comp_subscription,comp_subscription_information<br />
where comp_subscription.id=comp_subscription_information.comp_subscription_id<br />
  order by expiration_date&#8221; &gt; $FILE</p>
<p>Please advise<br />
Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Backup all sub-directories with a Bash array loop &#124; Edward A. Webb (.com)</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1348</link>
		<dc:creator>Backup all sub-directories with a Bash array loop &#124; Edward A. Webb (.com)</dc:creator>
		<pubDate>Thu, 15 Apr 2010 22:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1348</guid>
		<description>[...] If you want to backup your MySQL databases, I have that too, Shell script to backup multiple databases [...]</description>
		<content:encoded><![CDATA[<p>[...] If you want to backup your MySQL databases, I have that too, Shell script to backup multiple databases [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devi</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1214</link>
		<dc:creator>Devi</dc:creator>
		<pubDate>Mon, 21 Sep 2009 08:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1214</guid>
		<description>Really a nice article..</description>
		<content:encoded><![CDATA[<p>Really a nice article..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1013</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Tue, 21 Apr 2009 23:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1013</guid>
		<description>@Tony
Did you add the script specification at the start of the file 
&lt;code&gt;#! /bin/bash&lt;/code&gt;
and mark it executable?
&lt;code&gt;chmod 0755 daily_sql_backup.sh&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@Tony<br />
Did you add the script specification at the start of the file<br />
<code>#! /bin/bash</code><br />
and mark it executable?<br />
<code>chmod 0755 daily_sql_backup.sh</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-1010</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Tue, 21 Apr 2009 22:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-1010</guid>
		<description>Hi,

thanks for the post, I get:

/bin/sh: /var/www/vhosts/troid.org/httpdocs/backups/daily_sql_backup.sh: cannot execute binary file

So it seems the cron command is executing (had to delete the log part first) but it can&#039;t run the file, I&#039;m on Plesk if that means anything.

Appreciate your efforts!

Tony</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>thanks for the post, I get:</p>
<p>/bin/sh: /var/www/vhosts/troid.org/httpdocs/backups/daily_sql_backup.sh: cannot execute binary file</p>
<p>So it seems the cron command is executing (had to delete the log part first) but it can&#8217;t run the file, I&#8217;m on Plesk if that means anything.</p>
<p>Appreciate your efforts!</p>
<p>Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/simple-shell-script-backup-multiple-mysql-databases/comment-page-1/#comment-127</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Sun, 18 Jan 2009 18:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=306#comment-127</guid>
		<description>@teknoid
Thank you, I am glad it proved useful.</description>
		<content:encoded><![CDATA[<p>@teknoid<br />
Thank you, I am glad it proved useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

