<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James Emmrich &#187; Backup</title>
	<atom:link href="http://www.lwp.ca/james/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lwp.ca/james</link>
	<description>Just another motorcycle linux geek</description>
	<lastBuildDate>Sat, 19 Jun 2010 03:25:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automatic database backup via script</title>
		<link>http://www.lwp.ca/james/2010/02/automatic-database-backup-via-script/</link>
		<comments>http://www.lwp.ca/james/2010/02/automatic-database-backup-via-script/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 19:13:16 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ProTip]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tips 'n Hacks]]></category>

		<guid isPermaLink="false">http://www.lwp.ca/james/?p=475</guid>
		<description><![CDATA[As mentioned before somewhere in my blog, here is the script I have written to back up my databases. This is actually my local backup script, I have a much different one on the server which uses a passwordless ssh connection to backup the databases offsite. #!/bin/sh # Database backup 2008 &#60;jemmrich@gmail.com&#62; # Nightly Usage: [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned before somewhere in my blog, here is the script I have written to back up my databases. This is actually my local backup script, I have a much different one on the server which uses a passwordless ssh connection to backup the databases offsite.</p>
<pre>#!/bin/sh
# Database backup 2008 &lt;jemmrich@gmail.com&gt;
# Nightly Usage:
# 0 0 * * * /home/james/Dropbox/Home/mobilewolf/scripts/backup.sh &amp;&gt; /dev/null

LOGFILE="/home/james/Dropbox/Home/mobilewolf/databases/databases.log"
BACKUPDIR="/home/james/Dropbox/Home/mobilewolf/databases"
STARTTIME="$(date +%Y-%m-%d-%r)"

# MySQL Login
SQLUSER="sqluser"
SQLPASS="sqlpass"

# Dump databases
echo "*** Database Backup Started: $STARTTIME" &gt;&gt; $LOGFILE

# Keep yesterdays databases
rm -f $BACKUPDIR/yesterday/*
mv $BACKUPDIR/*.gz $BACKUPDIR/yesterday/

for i in `echo "show databases" | mysql -u $SQLUSER -p$SQLPASS | grep -v Database`;
do
 mysqldump -u $SQLUSER -p$SQLPASS $i &gt; /tmp/$i.sql
 echo $i &gt;&gt; $LOGFILE
 gzip /tmp/$i.sql

 # Send Databases
 cp /tmp/*.sql.gz $BACKUPDIR/

 # Remove our dumps to keep us clean
 rm -f /tmp/*.sql.gz
done

echo "*** Database Backup Ended: $(date +%Y-%m-%d-%r)" &gt;&gt; $LOGFILE
echo "\n" &gt;&gt; $LOGFILE</pre>
<p><strong>Setup</strong></p>
<ol>
<li>Change the user and password to a user that has ability to access all databases for dump</li>
<li>Download and set executable permissions chmod +x backup_databases.sh</li>
<li>edit cron to execute every night: crontab -e</li>
<li>add: 0 0 * * * /home/james/Dropbox/Home/mobilewolf/scripts/backup_databases.sh &amp;&gt; /dev/null</li>
</ol>
<p><strong>Ideas for your setup</strong></p>
<ul>
<li>The line following &#8220;Send databases&#8221; replace cp, with scp to send the databases to remote server. You will need to have passwordless ssh connections setup.</li>
<li>Have the log file emailed to you once completed</li>
</ul>
<p><strong>My Future Improvements</strong></p>
<ul>
<li>Enable backup archiving for the past week rotated daily so I can go back to a database from 2 or 3 days or even a week ago</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lwp.ca/james/2010/02/automatic-database-backup-via-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I use Dropbox on Ubuntu</title>
		<link>http://www.lwp.ca/james/2010/02/how-i-use-dropbox-on-ubuntu/</link>
		<comments>http://www.lwp.ca/james/2010/02/how-i-use-dropbox-on-ubuntu/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 22:45:00 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ProTip]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Tips 'n Hacks]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.lwp.ca/james/?p=468</guid>
		<description><![CDATA[Dropbox.com has become a huge time saver for me, and most likely a life saver as well. I have a folder in my Dropbox called Home. Here I have sub folders for each machine that I have. My two laptops, a desktop which hold computer specific files that are different for each computer I have. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.dropbox.com/referrals/NTE3MTE2Njk"><img class="alignleft size-full wp-image-472" title="dropbox_logo" src="http://www.lwp.ca/james/wp-content/uploads/2010/02/dropbox_logo_home.png" alt="" width="290" height="75" /></a><a href="https://www.dropbox.com/referrals/NTE3MTE2Njk">Dropbox.com</a> has become a huge time saver for me, and most likely a life saver as well.</p>
<p>I have a folder in my Dropbox called Home. Here I have sub folders for each machine that I have. My two laptops, a desktop which hold computer specific files that are different for each computer I have.</p>
<p>Files such as:</p>
<ul>
<li>/etc/hosts</li>
<li>/etc/fstab</li>
<li>/databases/</li>
</ul>
<p>Rather than copying these manually, I have simply moved the files to the dropbox and then symbolically linked them. That way when the system updates these files, Dropbox does it&#8217;s sync.</p>
<p>The databases folder is a folder which contains database dumps. My crontab is setup to nightly dump databases in tar form and place them here, for Dropbox to store.</p>
<p>I also have a folder called Resources. This contains files that are shared between computers. I have symbolically linked my .fonts folder here. Now whenever I install a new font for a design project, all my other computers are updated too.</p>
<p>For chat software like Pidgin and XChat, I have symbolically linked their folders .purple and xchat2 respectively, to my Dropbox home folder. Because these will be shared between computers I don&#8217;t have them in their respect computer sub folder. Now no matter what computer I chat on, my chat logs and software settings are up to date.</p>
<p>Projects that I work on are placed in my Dropbox under a folder called Projects, with each project as its own sub folder.</p>
<p>During my work, or daily routine I tend to shuffle, download, delete, and create new files. While I don&#8217;t always place these files to my Dropbox, I am very careful to not hold them on my laptops for long periods of time.</p>
<p>For files that I want to hold, I either move them to my Dropbox or to my NAS server depending solely on their importance and need of accessibility.</p>
<p><strong>The results</strong></p>
<p>I can now format my hard drive at any time, provided that Dropbox has had time to sync any changes. I also have the feeling of security knowing that my hard drive crashes will not take me out of commission.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lwp.ca/james/2010/02/how-i-use-dropbox-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
