<?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>maces-net.de &#187; bash</title>
	<atom:link href="http://maces-net.de/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://maces-net.de</link>
	<description>blogging on the geek side of live</description>
	<lastBuildDate>Wed, 18 Aug 2010 18:18:42 +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>Synchronisation V2</title>
		<link>http://maces-net.de/2008/10/04/synchronisation-v2/</link>
		<comments>http://maces-net.de/2008/10/04/synchronisation-v2/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 10:30:43 +0000</pubDate>
		<dc:creator>maces</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[synchronisation]]></category>

		<guid isPermaLink="false">http://www.maces-net.de/2008/10/04/synchronisation-v2/</guid>
		<description><![CDATA[Hier eine Verbesserte Version des Backup-Skripts]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>So hier eine verbesserte Version meines Skripts:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Home-verzeichnis mit USB-Festpaltte synchronisieren</span>
<span style="color: #666666; font-style: italic;"># Autor maces</span>
<span style="color: #666666; font-style: italic;"># Version 2</span>
<span style="color: #666666; font-style: italic;"># Mit diesem Skript koennen sie Ihr Home-Verzeichnis</span>
<span style="color: #666666; font-style: italic;"># z.B. mit einer USB-Festplatte</span>
<span style="color: #666666; font-style: italic;"># mithilfe des Programms -&amp;gt; sync &amp;lt;- synchronisieren</span>
<span style="color: #666666; font-style: italic;"># Den Usernamen und das backup Verzeichnis sollten sie</span>
<span style="color: #666666; font-style: italic;"># in den beiden kontrollen</span>
<span style="color: #666666; font-style: italic;"># und im Befehl anpassen.</span>
<span style="color: #666666; font-style: italic;"># parameter &amp;gt;&amp;gt; tousb &amp;lt;&amp;lt; synchroniesiert auf die Festplatte</span>
<span style="color: #666666; font-style: italic;"># parameter &amp;gt;&amp;gt; topc &amp;lt;&amp;lt; synchroniesiert auf den Computer</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># test ob usb-platte gemountet ist</span>
<span style="color: #666666; font-style: italic;"># hier muss der passende Pfad angegeben werden</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>USB-HDD<span style="color: #000000; font-weight: bold;">/</span> ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># Erfolgsmeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;SYNC-Ordner vorhanden&quot;</span>
<span style="color: #666666; font-style: italic;"># ansonsten</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #666666; font-style: italic;"># Fehlermeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;USB-Festplatte nicht gemountet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation kann nicht durchgefuert werden&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vorgang wird abgebrochen!&quot;</span>
<span style="color: #666666; font-style: italic;"># und Ende</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># überprüfen ob $USER der aktive user ist</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #007800;">$USER</span> == <span style="color: #ff0000;">&quot;maces&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># Erfolgsmeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Richtiger User ist angemeldet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Sync wird ausgeführt&quot;</span>
<span style="color: #666666; font-style: italic;"># ansonsten</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #666666; font-style: italic;"># Fehlermeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;falscher User ist angemeldet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation kann nicht durchgefuert werden&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vorgang wird abgebrochen!&quot;</span>
<span style="color: #666666; font-style: italic;"># und Ende</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># parameter prüfen ob auf pc-platte</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> $<span style="color: #000000;">1</span> == <span style="color: #ff0000;">&quot;topc&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># sync ausführen</span>
<span style="color: #666666; font-style: italic;"># backup-verzeichnis</span>
<span style="color: #666666; font-style: italic;"># auf der externen Festplatte</span>
<span style="color: #666666; font-style: italic;"># in home verzeichnis</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;starte Synchronisation&quot;</span>
<span style="color: #666666; font-style: italic;">#Pfade muessen angepasst werden</span>
rsync <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>USB-HDD <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>maces
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation erfolgreich durchgefuert&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># parameter prüfen ob auf usb-platte</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> $<span style="color: #000000;">1</span> == <span style="color: #ff0000;">&quot;tousb&quot;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># sync ausführen</span>
<span style="color: #666666; font-style: italic;"># home verzeichnis</span>
<span style="color: #666666; font-style: italic;"># in backup-verzeichnis</span>
<span style="color: #666666; font-style: italic;"># auf der externen Festplatte</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;starte Synchronisation&quot;</span>
<span style="color: #666666; font-style: italic;"># Pfade muessen angepasst werden</span>
rsync <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>maces <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>USB-HDD
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation erfolgreich durchgefuert&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sonstige meldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;keine Parameter angegeben&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;nutze &amp;gt;&amp;gt; tousb &amp;lt;&amp;lt; &quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;oder nutze &amp;gt;&amp;gt; topc &amp;lt;&amp;lt; &quot;</span>
<span style="color: #666666; font-style: italic;"># ende</span></pre></td></tr></table></div>

<p>Jetzt kann/muss man einen der beiden Parameter (tousb, topc) angeben und es wird dorthin synchronisiert. Ansonsten sollten die Kommentare alles erklären, bzw der letzte Beitrag mit Version 1. Auf der <a href="http://www.maces-net.de/projekte/synchronisation/" target="_self">Projektseite</a> gibt es die aktuelleste Version.</p>
<p>maces</p>
]]></content:encoded>
			<wfw:commentRss>http://maces-net.de/2008/10/04/synchronisation-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchronisation</title>
		<link>http://maces-net.de/2008/10/03/synchronisation/</link>
		<comments>http://maces-net.de/2008/10/03/synchronisation/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 10:30:42 +0000</pubDate>
		<dc:creator>maces</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[synchronisation]]></category>

		<guid isPermaLink="false">http://www.maces-net.de/?p=74</guid>
		<description><![CDATA[Das folgende Skript ist in der Lage das Homeverzeichnis des Benutzers mit einem Synchronisationsverzeichnis auf einer externen USB-Festplatte zu synchronisieren. Dazu nutzt es rsync. Getestet mit Ubuntu 7.10 Gusty Gibbon (Gnome).]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>Das folgende Skript ist in der Lage das Homeverzeichnis des Benutzers mit einem Synchronisationsverzeichnis auf einer externen USB-Festplatte zu synchronisieren. Dazu nutzt es rsync. Getestet mit Ubuntu 7.10 Gusty Gibbon (Gnome).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Home-verzeichnis mit USB-Festpaltte</span>
<span style="color: #666666; font-style: italic;"># synchronisieren</span>
<span style="color: #666666; font-style: italic;"># Autor maces</span>
<span style="color: #666666; font-style: italic;"># Mit diesem Skript koennen sie Ihr</span>
<span style="color: #666666; font-style: italic;"># Home-Verzeichnis</span>
<span style="color: #666666; font-style: italic;"># z.B. mit einer USB-Festplatte</span>
<span style="color: #666666; font-style: italic;"># mithilfe des Programms -&amp;gt; sync &amp;lt;-</span>
<span style="color: #666666; font-style: italic;"># synchronisieren</span>
<span style="color: #666666; font-style: italic;"># Den Usernamen und das Backup Verzeichnis</span>
<span style="color: #666666; font-style: italic;"># sollten sie</span>
<span style="color: #666666; font-style: italic;"># in den beiden Kontrollen</span>
<span style="color: #666666; font-style: italic;"># und im Befehl anpassen.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># test ob usb-platte gemountet ist</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>IOMEGA_HDD<span style="color: #000000; font-weight: bold;">/</span>backups ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># Erfolgsmeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;SYNC-Ordner vorhanden&quot;</span>
<span style="color: #666666; font-style: italic;"># ansonsten</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #666666; font-style: italic;"># Fehlermeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;USB-Festplatte nicht gemountet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation kann nicht durchgefuert werden&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vorgang wird abgebrochen!&quot;</span>
<span style="color: #666666; font-style: italic;"># und Ende</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># überprüfen ob maces der aktive User ist</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #007800;">$USER</span> == <span style="color: #ff0000;">&quot;maces&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #666666; font-style: italic;"># Erfolgsmeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Richtiger User ist angemeldet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation wird ausgeführt&quot;</span>
<span style="color: #666666; font-style: italic;"># ansonsten</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #666666; font-style: italic;"># Fehlermeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;falscher User ist angemeldet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation kann nicht durchgefuert werden&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vorgang wird abgebrochen!&quot;</span>
<span style="color: #666666; font-style: italic;"># und Ende</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># sync ausführen</span>
<span style="color: #666666; font-style: italic;"># home verzeichnis</span>
<span style="color: #666666; font-style: italic;"># in backup-verzeichnis</span>
<span style="color: #666666; font-style: italic;"># auf der externen Festplatte</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;starte Synchronisation&quot;</span>
rsync <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>maces <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>IOMEGA_HDD<span style="color: #000000; font-weight: bold;">/</span>backups
<span style="color: #666666; font-style: italic;"># erfolgsmeldung</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Synchronisation erfolgreich durchgefuert&quot;</span>
<span style="color: #666666; font-style: italic;"># ende</span></pre></td></tr></table></div>

<p>Diese Skript müssen Sie nun mit <span id="SPELLING_ERROR_49" class="blsp-spelling-error">Rootrechten</span> im Verzeichnis /<span id="SPELLING_ERROR_50" class="blsp-spelling-error">usr</span>/bin/ als ausführbare Datei speichern. Das erreichen Sie so:<br />
Drücken sie <strong>[ALT]+[F2]</strong> (Befehlsfenster) und geben Sie<strong> gksudo nautilus</strong> (Nautilus mit Rootrechten starten) ein.<br />
Daraufhin müssen sie ihr Rootpasswort eingeben.<br />
Jetzt wechseln Sie in den Ordner <strong>/usr/bin/</strong> und erstellen eine neue Datei.<br />
Nennen sie diese Datei <strong>sync</strong> jetzt öffnen Sie diese Datei und füllen diese mit dem obigen Inhalt. Rechts klicken Sie jetzt auf diese Datei und wählen <strong>Eigenschaften</strong>. Wechseln sie in den Reiter <strong>Zugriffsrechte</strong>. Wählen sie nun <strong>Datei als Programm ausführen</strong> und schließen den Dialog. Jetzt sollten sie durch das aufrufen des Befehls <strong>sync</strong> (In einem Terminal) die erwünschte Synchronisation durchführen können.<br />
Jetzt können sie selbstverständlich diesen Befehl beim Starten oder beim Runterfahren des PC&#8217;s benutzen um Ihre Daten zu Synchronisieren.</p>
<p>Ich hoffe das Skript kann euch helfen, für Feedback einfach kommentieren <img src='http://maces-net.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  die aktuellste Version gibt es auf der <a href="http://www.maces-net.de/projekte/synchronisation/" target="_self">Projektseite</a>.</p>
<p>maces</p>
]]></content:encoded>
			<wfw:commentRss>http://maces-net.de/2008/10/03/synchronisation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 1/9 queries in 0.003 seconds using disk
Object Caching 280/292 objects using disk

Served from: maces-net.de @ 2010-09-10 19:40:33 -->