<?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>{Complexity} &#187; Scripts</title>
	<atom:link href="http://technote.wsjoung.com/tag/scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://technote.wsjoung.com</link>
	<description>simple note</description>
	<lastBuildDate>Wed, 09 Nov 2011 02:12:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Incremental backup scripts</title>
		<link>http://technote.wsjoung.com/2008/05/09/incremental-backup-scripts/</link>
		<comments>http://technote.wsjoung.com/2008/05/09/incremental-backup-scripts/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:20:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=92</guid>
		<description><![CDATA[#!/bin/bash # # creates backups of essential files # DATA="/home /root /usr/local/httpd" CONFIG="/etc /var/lib /var/named" LIST="/tmp/backlist_$$.txt" # mount /mnt/backup set $(date) # if test "$1" = "Sun" ; then # weekly a full backup of all data and config. settings: tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA rm -f /mnt/backup/data/data_diff* # tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz" $CONFIG rm -f /mnt/backup/config/config_diff* [...]]]></description>
			<content:encoded><![CDATA[<pre>#!/bin/bash
#
# creates backups of essential files
#
DATA="/home /root /usr/local/httpd"
CONFIG="/etc /var/lib /var/named"
LIST="/tmp/backlist_$$.txt"
#
mount /mnt/backup
set $(date)
#
if test "$1" = "Sun" ; then
        # weekly a full backup of all data and config. settings:
        tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA
        rm -f /mnt/backup/data/data_diff*
        #
        tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz" $CONFIG
        rm -f /mnt/backup/config/config_diff*
else
        # incremental backup:
        find $DATA -depth -type f \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST
        tar cfzT "/mnt/backup/data/data_diff_$6-$2-$3.tgz" "$LIST"
        rm -f "$LIST"
        #
        find $CONFIG -depth -type f  \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST
        tar cfzT "/mnt/backup/config/config_diff_$6-$2-$3.tgz" "$LIST"
        rm -f "$LIST"
fi
#
# create sql dump of databases:
mysqldump -u root --password=mypass --opt mydb &gt; "/mnt/backup/database/mydb_$6-$2-$3.sql"
gzip "/mnt/backup/database/mydb_$6-$2-$3.sql"
#
umount /mnt/backup
</pre>
<p><a href="http://www.xs4all.nl/~voorburg/backup.html">&gt;&gt; Backup script for Linux using tar and find</a></p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2008/05/09/incremental-backup-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

