<?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>monkey-business.biz &#187; Linux</title> <atom:link href="http://www.monkey-business.biz/tag/linux/feed/" rel="self" type="application/rss+xml" /><link>http://www.monkey-business.biz</link> <description>Belästigung der Allgemeinheit - der private Weblog</description> <lastBuildDate>Tue, 24 Jan 2012 14:53:33 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>daily</sy:updatePeriod> <sy:updateFrequency>4</sy:updateFrequency> <item><title>Das Installationsdatum eines Linuxsystems &#8211; Copy &amp; Paste Tipp 2011</title><link>http://www.monkey-business.biz/1795/das-installationsdatum-eines-linuxsystems-copy-paste-tipp-2011/</link> <comments>http://www.monkey-business.biz/1795/das-installationsdatum-eines-linuxsystems-copy-paste-tipp-2011/#comments</comments> <pubDate>Tue, 05 Apr 2011 19:15:22 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Blogger]]></category> <category><![CDATA[Copy & Paste]]></category> <category><![CDATA[Installationsdatum]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Tipps & Tricks]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1795</guid> <description><![CDATA[Im Web finden sich viele, für solche Infos gern verwendete, Blogs und Foren in denen nachzulesen ist wie denn nun das Installationsdatums eines Linux Systems rauszufinden ist. Eine kleine Sammlung aus der Google Suche: pro-linux.de erasel.net unixboard.de oldwiki.christian-stankowic.org Ich fand das Thema auch interessant und dachte mir das ich das posten würde. Jetzt wars eben [...]]]></description> <content:encoded><![CDATA[<p>Im Web finden sich viele, für solche Infos gern verwendete, Blogs und Foren in denen nachzulesen ist wie denn nun das Installationsdatums eines Linux Systems rauszufinden ist. Eine kleine Sammlung aus der <a href="http://www.google.com/search?hl=de&#038;source=hp&#038;q=installationsdatum+eines+linux+systems" target="_blank" rel="nofollow">Google Suche</a>:</p><ul><li><a href="http://www.pro-linux.de/kurztipps/2/1317/installationsdatum-seines-systems-herausfinden.html" target="_blank" rel="nofollow">pro-linux.de</a></li><li><a href="http://erasel.net/2010-04-27/installationsdatum-eines-linux-systems.html" target="_blank" rel="nofollow">erasel.net</a></li><li><a href="http://www.unixboard.de/vb3/showthread.php?742-Kurztipp-Installationsdatum-seines-Systems-herausfinden" target="_blank" rel="nofollow">unixboard.de</a></li><li><a href="http://oldwiki.christian-stankowic.org/index.php?title=Installationsdatum_eines_Linux-Systems_herausfinden" target="_blank" rel="nofollow">oldwiki.christian-stankowic.org</a></li></ul><p>Ich fand das Thema auch interessant und dachte mir das ich das posten würde. Jetzt wars eben doof, das ich mein Installationsdatum genau wusste. Das Ausführen des Kommandos:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">--sort</span>=t <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $8 &quot; &quot; $7 &quot; &quot; $9}'</span></pre></div></div><p>bzw. von:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">--sort</span>=t <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $8 &quot; &quot; $7 &quot; &quot; $8}'</span></pre></div></div><p>brachte mir ein falsches Ergebnis (20:51-2009-04-27) auf meinem Desktop Rechner (Ubuntu Hardy). Richtig wäre gewesen 18:10-2008-08-07. Ebenso auf dem Server (Debian Lenny davor Sarge) 05:20-2011-01-22 statt 16:07-2006-11-28. Die passenden Ergebnisse liefert mir:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">--sort</span>=t <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $8 &quot; &quot; $7 &quot; &quot; $9}'</span></pre></div></div><p>bzw.:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">--sort</span>=t <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $8 &quot; &quot; $7 &quot; &quot; $8}'</span></pre></div></div><p>Die Dateien unter /dev müssen sich nach einem System Update verändert worden sein. Unter Ubuntu kann der Installationszeitpunkt bzw. das Datum auch anhand des Ordners /lost+found/ im root Verzeichnis abgelesen werden. Dieser wird bei der Installation angelegt und nicht weiter verändert.</p><p>Abgesehen von der Tatsache wie viele Leute sich inzwischen sicher an einem falschen Installationsdatum erfreut hatten ist es interessant wir sich ein kurz Tipp durchs Web verbreitet. Für mich ist das der Blogger Copy &#038; Paste Tipp 2011. Deswegen gibts den auch bei mir im Blog. <img src='http://www.monkey-business.biz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Mich würde interessieren wann ihr eure Systeme installiert habt oder ob noch jemand mit Ubuntu Hardy unterwegs ist.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1795/das-installationsdatum-eines-linuxsystems-copy-paste-tipp-2011/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux: Prozesse beenden / kill processes</title><link>http://www.monkey-business.biz/1166/linux-prozesse-beenden-kill-processes/</link> <comments>http://www.monkey-business.biz/1166/linux-prozesse-beenden-kill-processes/#comments</comments> <pubDate>Fri, 19 Nov 2010 13:08:25 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[beenden]]></category> <category><![CDATA[kill processes]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Prozesse]]></category> <category><![CDATA[Tutorial]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1166</guid> <description><![CDATA[Das Beenden bzw. killen von Prozessen unter Linux / Unixoiden Systemen erfolgt in der Regel über das kill-Kommando in der Konsole. Bevor dieses Kommando zum &#8220;killen&#8221; des Prozessen benutzbar ist muss jedoch die Prozess ID ermittelt werden. Für das ermitteln der Prozess ID empfehle ich die Konsolen-Kommando Kombination: ps aux &#124; grep &#60;PROZESSNAME&#62; &#60;PROZESSNAME&#62; ist [...]]]></description> <content:encoded><![CDATA[<p>Das Beenden bzw. killen von Prozessen unter Linux / Unixoiden Systemen erfolgt in der Regel über das kill-Kommando in der Konsole. Bevor dieses Kommando zum &#8220;killen&#8221; des Prozessen benutzbar ist muss jedoch die Prozess ID ermittelt werden. Für das ermitteln der Prozess ID empfehle ich die Konsolen-Kommando Kombination:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSNAME<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>&lt;PROZESSNAME&gt; ist mit dem Prozess Name zu ersetzen. Beispielsweise &#8220;apache&#8221;. Das &#8220;apache&#8221; Beispiel beschert mir auf einem Server diese Ausgabe:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">www-data <span style="color: #000000;">18148</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.1</span> <span style="color: #000000;">232000</span>  <span style="color: #000000;">8664</span> ?        S    Nov18   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apache2 <span style="color: #660033;">-k</span> start
www-data <span style="color: #000000;">18158</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.1</span> <span style="color: #000000;">232000</span>  <span style="color: #000000;">8688</span> ?        S    Nov18   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apache2 <span style="color: #660033;">-k</span> start</pre></div></div><p>Es ist auch möglich, sofern der genaue Prozessename bekannt ist, das Kommando &#8220;pidof&#8221; zu nutzen.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">pidof</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSNAME<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>Der Output zu diesem Befehl enthält die Prozess ID&#8217;s oder die Prozess ID je nach Anzahl der laufenden Prozesse mit dem selben Namen.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">8664</span> <span style="color: #000000;">8688</span></pre></div></div><p>Der zweite Schritt ist das eigentliche Beenden des Prozesses mit Hilfe des Kommandos kill.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSID<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSID<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>Prozess ID&#8217;s können mit einem Leerzeichen separiert angegeben werden. Sollte sich auf diesem Wege ein Prozess nicht beenden lassen kann mit der Option &#8220;-9&#8243; des Befehls kill entgegen gewirkt werden.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-9</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSID<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>In diesem Fall wird der Prozess &#8220;hart&#8221; beendet. Es können ebenfalls mehrere ID&#8217;s mit einem Leerzeichen separiert werden.<br /> Eine andere Art mehrere Prozesse auf einen Streich zu terminieren stellt der Befehl killall da.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PROZESSNAME<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>Der Parameter &#8220;-i&#8221; sorgt dafür das vor dem Beenden jedes Prozesses nochmals nachgefragt wird ob man ihn wirklich beenden möchte.  Weitere wichtige Optionen sind die Befehle:</p><ul><li>-u &lt;UNIXUSERID&gt; <em>beendet die Prozesse des gewählen UNIX Benutzers</em></li><li>-g &lt;PROZESSGRUPPENID&gt; <em>beendet die Prozesse der gewählten Prozessgruppe</em></li></ul><p>Die Möglichkeit mehrere Prozesse mit einem Befehl zu beenden hat mir persönlich oft weitergeholfen als Server Dienste am spinnen waren. Schönes Wochenende. <img src='http://www.monkey-business.biz/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p><strong>EDIT:</strong> Beachte das du zum killen einiger Prozesse als root angemeldet sein musst.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1166/linux-prozesse-beenden-kill-processes/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Debian Backups verschlüsseln &#8211; Artikel Update</title><link>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/</link> <comments>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/#comments</comments> <pubDate>Sun, 23 May 2010 14:07:06 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[verschlüsselt]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=920</guid> <description><![CDATA[Mein Artikel &#8220;Debian Backup mittels Paketlisten &#38; MySQL Dumps &#38; FTP Upload&#8221; wurde soeben aktuallisiert. Das Script passt nun die Prozess und I/O Priorität für den eigenen Prozess an um den Server nicht bei seinen regulären Arbeiten zu behindern und verschlüsselt das Backup auf Wunsch mit GnuPG. Zum Artikel gehts mit diesem Link: Verschlüsseltes Debian [...]]]></description> <content:encoded><![CDATA[<p>Mein Artikel <a title="Debian Backups verschlüsseln" href="/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/">&#8220;Debian Backup mittels Paketlisten &amp; MySQL Dumps &amp; FTP Upload&#8221;</a> wurde soeben aktuallisiert. Das Script passt nun die Prozess und I/O Priorität für den eigenen Prozess an um den Server nicht bei seinen regulären Arbeiten zu behindern und verschlüsselt das Backup auf Wunsch mit GnuPG.</p><p>Zum Artikel gehts mit diesem Link: <a title="Debian Backups verschlüsseln" href="/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/">Verschlüsseltes Debian Backup</a></p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Shell History deaktivieren</title><link>http://www.monkey-business.biz/970/shell-history-deaktivieren/</link> <comments>http://www.monkey-business.biz/970/shell-history-deaktivieren/#comments</comments> <pubDate>Sat, 15 May 2010 17:25:55 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[History]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Shell]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=970</guid> <description><![CDATA[Wenn man sich in der Shell nicht auf die Finger schauen lassen will kann mit dem Kommando unset HISTFILE abhilfe schaffen. Der Befehl deaktiviert die Shell History (den Verlauf) für die aktuelle Sitzung. Beim neu Einloggen ist der Standard wiederhergestellt und die Shell History wieder aktiviert.]]></description> <content:encoded><![CDATA[<p>Wenn man sich in der Shell nicht auf die Finger schauen lassen will kann mit dem Kommando</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">unset</span> HISTFILE</pre></div></div><p>abhilfe schaffen. Der Befehl deaktiviert die Shell History (den Verlauf) für die aktuelle Sitzung. Beim neu Einloggen ist der Standard wiederhergestellt und die Shell History wieder aktiviert.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/970/shell-history-deaktivieren/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux: Torrents über die Shell mit Bittornado herunterladen</title><link>http://www.monkey-business.biz/860/linux-torrents-uber-die-shell-mit-bittornado-herunterladen/</link> <comments>http://www.monkey-business.biz/860/linux-torrents-uber-die-shell-mit-bittornado-herunterladen/#comments</comments> <pubDate>Sat, 08 May 2010 19:09:58 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Bittornado]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Torrent]]></category> <category><![CDATA[Tutorial]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=860</guid> <description><![CDATA[Torrents mit dem eigenen Server herunterzuladen ist nicht nur schonend für die eigene Leitung Zuhause sondern schont ebenso die Internet Leitungen der Open Source Projekte von dessen HTTP Servern der Download ansonsten stattfinden würde. Aus diesem Grund lade ich seit längerem größere Dateien gerne über die, sofern vorhanden, verfügbaren Torrent Quellen herunter. Dazu verwende ich [...]]]></description> <content:encoded><![CDATA[<p>Torrents mit dem eigenen Server herunterzuladen ist nicht nur schonend für die eigene Leitung Zuhause sondern schont ebenso die Internet Leitungen der Open Source Projekte von dessen HTTP Servern der Download ansonsten stattfinden würde. Aus diesem Grund lade ich seit längerem größere Dateien gerne über die, sofern vorhanden, verfügbaren Torrent Quellen herunter. Dazu verwende ich den Konsolen basierenden Bittorrent Client Bittornado im Zusammenspiel mit dem allseits bekannten Screen.</p><p>Die Installation beider Komponenten gestaltet sich unter Debian oder Ubuntu sehr einfach. Ein kurzes</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> bittornado <span style="color: #c20cb9; font-weight: bold;">screen</span></pre></div></div><p>reicht aus um die Installation auszuführen. Für andere Distributionen empfehle ich die Programme über den jeweiligen Paketmanager zu installieren. Ein compilieren der Quellcodes ist meiner Meinung nach zu aufwändig.</p><p>Zum starten des Bittornado Daemons aus der Shell verwende ich ein kleines von mir geschriebenes Script. Dieses macht es möglich den UNIX Benutzer, das Download Verzeichnis sowie die maximale Anzahl von Uploads und die Uploadbandbreite festzulegen. Ich limitere den Upload um nicht zu viel Traffic zu erzeugen. Der Benutzer wird festgelegt um bei einer Exploitmöglichkeit für Bittornado keine umfassenden Angriffspunkte am System zu bieten. Sehr interessant ist hierbei auch das Bittornado in der Programmiersprache Python geschrieben ist. Dadurch wird etwas mehr Speicher und Rechenzeit benötigt. Was für mich keine Relevanz hat. Im Gegenzug können keine Buffer Overflows auftreten.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Author: Tobias Jäck</span>
<span style="color: #666666; font-style: italic;">## License: GPL version 3</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">&quot;webservices&quot;</span>
&nbsp;
<span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;/home/webservices/incoming/&quot;</span>
&nbsp;
<span style="color: #007800;">MAX_UPLOADS</span>=<span style="color: #ff0000;">&quot;6&quot;</span>
&nbsp;
<span style="color: #007800;">MAX_UPLOAD_BANDWIDTH</span>=<span style="color: #ff0000;">&quot;14&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;/Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-AmdS</span> bittornado <span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #800000;">${USER}</span>  <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;btlaunchmanycurses <span style="color: #007800;">${DIR}</span>  --minport 50000 --maxport 55000 --max_uploads <span style="color: #007800;">${MAX_UPLOADS}</span> --max_upload_rate <span style="color: #007800;">${MAX_UPLOAD_BANDWIDTH}</span>&quot;</span></pre></div></div><p>Das Script wird mit</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">&lt;</span>SCRIPTNAME<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>lauffähig gemacht und mit</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/&lt;</span>SCRIPTNAME<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>aufgerufen. Das Vorgehen ist bei allen Scripten unter UNIX Systemen gleich. Auch mein Script stellt da keine Ausnahme da. Der im Script hinterlegte Benutzer und das Verzeichnis musst du vorher natürlich noch für dein System anpassen. Nach dem Aufruf des Scriptes passiert scheinbar nichts. Im Hintergrund wurde jedoch eine Screen Sitzungen mit Bittornado gestartet.</p><p>Um einen Download zu starten muss eine gültige .torrent Datei in das im soeben gestartete Script angegebene Verzeichnis verschoben werden. Kurze Zeit später beginnt der Download des Torrents in Bittornado. Der aktuelle Stand der Downloadvorgänge kann mit</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span></pre></div></div><p>oder, falls mehere Screen Sitzungen zur selben Zeit aktiv sind mit</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> bittornado</pre></div></div><p>abgefragt werden. Wichtig ist es hierbei die Download Übersicht über screen mit <strong>strg + a</strong> und dem anschließendem Drücken der <strong>d</strong> Taste zu schließen. Ein eingeben der Tastenkombination strg + c würde Bittornado umgehend beenden und den Download abbrechen.</p><p>Den fertigen Dowload findest du im Download Verzeichnis neben den .torrent Dateien.</p><p>Natürlich könnte Bittornado auch mit dem manuellen eintippen der Befehle ohne das Startscript auf die selbe Art und Weise gestartet werden. Diese Arbeit möchte niemand antun. Insbesondere nicht ich. Ich denke mein Startscript für Bittornado ist mehr als hilfreich.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/860/linux-torrents-uber-die-shell-mit-bittornado-herunterladen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PHP Shell &#8211; Shellzugriff mit PHP</title><link>http://www.monkey-business.biz/817/php-shell-shellzugriff-mit-php/</link> <comments>http://www.monkey-business.biz/817/php-shell-shellzugriff-mit-php/#comments</comments> <pubDate>Sat, 24 Apr 2010 17:37:55 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Shell]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=817</guid> <description><![CDATA[Shellzugriff aus dem Browser heraus ist nicht nur geschickt sondern in streng konfigurierten Netzwerken auch die einzige Möglichkeit Shellzugriff auf den Server zu bekommen. Hierfür kann ich dir PHP Shell empfehlen. Shellkommandos lassen sich damit ausführen und die Ergebnisse der Kommandos ansehen. Leider lassen sich Programme wie Nano mit der PHP Shell nicht ausführen. Autovervollständigung [...]]]></description> <content:encoded><![CDATA[<p>Shellzugriff aus dem Browser heraus ist nicht nur geschickt sondern in streng konfigurierten Netzwerken auch die einzige Möglichkeit Shellzugriff auf den Server zu bekommen. Hierfür kann ich dir <a href="http://phpshell.sourceforge.net/" title="PHP Shell Projekt Webseite" target="_blank">PHP Shell</a> empfehlen. Shellkommandos lassen sich damit ausführen und die Ergebnisse der Kommandos ansehen.</p><p>Leider lassen sich Programme wie Nano mit der PHP Shell nicht ausführen. Autovervollständigung mittels TAB unterstützt das Shell Werkzeug ebenfalls nicht.</p><p>Neben dem starten des PHP Shell Scriptes als root ist es eine weitere Vorraussetzung  &#8220;Safe Mode&#8221; zu deaktivieren und das Ausführen der Funktion proc_open() zu erlauben.</p><p>Ich kann euch diese kleine Webapplikation nur ans Herz legen.</p><p>Links:</p><ul><li><a href="http://phpshell.sourceforge.net/" title="PHP Shell Projekt Webseite" target="_blank">Projektseite auf Sourceforge</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/817/php-shell-shellzugriff-mit-php/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux: Löschen von archivierten Log Dateien</title><link>http://www.monkey-business.biz/665/linux-loschen-von-archivierten-log-dateien/</link> <comments>http://www.monkey-business.biz/665/linux-loschen-von-archivierten-log-dateien/#comments</comments> <pubDate>Sun, 11 Apr 2010 15:15:33 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Dateien]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Log]]></category> <category><![CDATA[Shell]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=665</guid> <description><![CDATA[Jeder Daemon auf einem Linux System führt eine Log Datei im Verzeichnis /var/log. Ab einer gewissen Laufzeit finden sich dort mehere Megabyte an archivierten Log Dateien. Das händische löschen von archivierten Log Datein ist eine nervige Sache. Um mir Nerven und Zeit zu ersparen habe ich mir ein Script geschrieben das mir diese Arbeit abnimmt. [...]]]></description> <content:encoded><![CDATA[<p>Jeder Daemon auf einem Linux System führt eine Log Datei im Verzeichnis /var/log. Ab einer gewissen Laufzeit finden sich dort mehere Megabyte an archivierten Log Dateien. Das händische löschen von archivierten Log Datein ist eine nervige Sache. Um mir Nerven und Zeit zu ersparen habe ich mir ein Script geschrieben das mir diese Arbeit abnimmt.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Author: Tobias Jäck</span>
<span style="color: #666666; font-style: italic;">## License: GPL version 3</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Logfile</span>
<span style="color: #007800;">LOGFILE</span>=<span style="color: #ff0000;">&quot;/var/log/cleanup.log&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iname</span> <span style="color: #000000; font-weight: bold;">*</span>.gz <span style="color: #660033;">-type</span> f <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-fv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \; <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>		
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">else</span>	
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div><p>Das Script sucht mit &#8220;find&#8221; im Verzeichnis /var/log nach archivierten Log Dateien (Dateien mit der Endung .gz) und entfernt diese. Ironischer Weise legt das Script ebenfalls eine Log Datei an (/var/log/cleanup.log) in der gelöschte Dateien und Probleme niedergeschrieben werden.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/665/linux-loschen-von-archivierten-log-dateien/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Debian Backup mittels Paketlisten &amp; MySQL Dumps &amp; FTP Upload</title><link>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/</link> <comments>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/#comments</comments> <pubDate>Sun, 14 Mar 2010 13:39:29 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[dpkg]]></category> <category><![CDATA[FTP]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Paketlisten]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=282</guid> <description><![CDATA[Auf der Suche nach einem Backup Shell Script für meinen Debian Server wurde ich in den weiten des Internets nicht fündig. Zumindest fand ich kein Script das genau das tat was ich wollte. Also machte ich mich selbst ans Werk. Vorweg: Das Script erstellt nicht einfach eine simple Kopie des Festplatteninhalts. Dies verbraucht meiner Meinung [...]]]></description> <content:encoded><![CDATA[<p>Auf der Suche nach einem Backup Shell Script für meinen Debian Server wurde ich in den weiten des Internets nicht fündig. Zumindest fand ich kein Script das genau das tat was ich wollte. Also machte ich mich selbst ans Werk. Vorweg: Das Script erstellt nicht einfach eine simple Kopie des Festplatteninhalts. Dies verbraucht meiner Meinung nach zu viel Speicherplatz. Sämtliche Debian Binarys müssen nämlich nicht gesichert werden. Denn diese sind von den Servern aus der sources.list abrufbar. Einzig und allein die Binarys unter /usr/local/ werden, neben den Konfigurationsdateien unter /etc/ und den Dateien unter /var/ /home/ und /root/, gesichtert. Natürlich können diese Verzeichnisse geändert werden. Es reicht die Variable TOBACKUP im Konfigurationsteil des Scriptes um die entsprechenden Verzeichnisse zu erweitern oder mit Hilfe der Variable TOEXCLUDE Unterverzeichnisse vom Backup auszuschließen. Die Kernel Version, Distribution, Architektur und der Installationszeitpunkt des Systems werden nochmals seperat in der Datei uname.txt gesichert.</p><p>Ebenso erstellt das Script SQL Dumps von allen MySQL Datenbanken des Servers und läd das gesamte Backup, verschlüsselt oder nur komprimiert, optional auch auf einen FTP Space übertragen. Wichtig ist das das Verzeichnis das in OUTDIR eingetragen ist exisitert. Sowohl bei lokalem speichern des Backups als auch beim remote Backup Vorgang auf den FTP Space. Eine Übertragung auf einen FTP Backup Space erfolgt nur, wenn FTP Zugangsdaten hinterlegt sind. Sollte etwas in die Option BACKUPPASS eingetragen sein verschlüsselt das Script die Daten mit GnuPG.</p><p>Die Kommentare im Script habe ich in englisch gehalten. Damit sollte eigentlich jeder zurecht kommen und ich muss das Script nicht mehrsprachig kommentiert online stellen. Auf alle Konfigurationsoptionen möchte ich hier im Text nicht weiter eingehen. Die Variablenbezeichnungen sowie die Kommentare sollten alles erklären.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Author: Tobias Jäck</span>
<span style="color: #666666; font-style: italic;">## License: GPL version 3</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Backup prefix</span>
<span style="color: #007800;">PREFIX</span>=<span style="color: #ff0000;">&quot;yourprefix_&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dirs which should be backed</span>
<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;/root/ /home/ /etc/ /var/ /usr/local/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dirs which shouldn't be backed</span>
<span style="color: #007800;">TOEXCLUDE</span>=<span style="color: #ff0000;">&quot;/yourdirstoexclude/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## MySQL login data</span>
<span style="color: #007800;">MYSQLUSER</span>=<span style="color: #ff0000;">&quot;yoursqluser&quot;</span>
<span style="color: #007800;">MYSQLPASS</span>=<span style="color: #ff0000;">&quot;yoursqlpass&quot;</span>
<span style="color: #007800;">MYSQLHOST</span>=<span style="color: #ff0000;">&quot;yoursqlhost&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dir to save backup</span>
<span style="color: #007800;">OUTDIR</span>=<span style="color: #ff0000;">&quot;yourdirtosave&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## FTP login form the backup FTP server (optional)</span>
<span style="color: #007800;">FTPHOST</span>=<span style="color: #ff0000;">&quot;optionalyourftphost&quot;</span>
<span style="color: #007800;">FTPUSER</span>=<span style="color: #ff0000;">&quot;optionalyourftpuser&quot;</span>
<span style="color: #007800;">FTPPASS</span>=<span style="color: #ff0000;">&quot;optionalyourftppss&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Backup password (optional)</span>
<span style="color: #007800;">BACKUPPASS</span>=<span style="color: #ff0000;">&quot;optionalyourpassword&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Working dir</span>
<span style="color: #007800;">WORKINGDIR</span>=<span style="color: #ff0000;">&quot;/tmp/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Logfile</span>
<span style="color: #007800;">LOGFILE</span>=<span style="color: #ff0000;">&quot;/var/log/<span style="color: #007800;">${PREFIX}</span>backup.log&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;/Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Set prozess priority</span>
	renice <span style="color: #660033;">-19</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$$</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Set I/O priority</span>
	ionice <span style="color: #660033;">-c2</span> <span style="color: #660033;">-n1</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$$</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Date and time</span>
	<span style="color: #007800;">DATE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+%Y-%m-%d-%H-%M-%S&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create and enter working dir</span>
	<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
	<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Save version</span>
	<span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;uname.txt&quot;</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> uname.txt&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create a list with installed deb pakets</span>
	<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;deb.list&quot;</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> deb.list&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create MySQL dump environment</span>
	<span style="color: #c20cb9; font-weight: bold;">mkdir</span> mysqldumps<span style="color: #000000; font-weight: bold;">/</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> mysqldumps/&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create MySQL dumps from all databases</span>
	<span style="color: #007800;">DBS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(mysql  -h $MYSQLHOST -u $MYSQLUSER -p$MYSQLPASS -Bse 'show databases' 2&gt;&gt; $LOGFILE)</span>&quot;</span>	
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Delete temporary files</span>
		<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">for</span> DB <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$DBS</span>; <span style="color: #000000; font-weight: bold;">do</span>
		mysqldump <span style="color: #660033;">-h</span> <span style="color: #007800;">$MYSQLHOST</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$MYSQLUSER</span> -p<span style="color: #007800;">$MYSQLPASS</span> <span style="color: #007800;">$DB</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;mysqldumps/<span style="color: #007800;">${DB}</span>.sql&quot;</span>
	<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">## Exclude dirs</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOEXCLUDE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #007800;">TOEXCLUDE</span>=<span style="color: #ff0000;">&quot;--exclude <span style="color: #007800;">${TOEXCLUDE}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Compress and / or encrypt files</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BACKUPPASS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>	
&nbsp;
		<span style="color: #007800;">VAR_EXTENSION</span>=<span style="color: #ff0000;">&quot;.tar.bz2.gpg&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cf</span> - <span style="color: #007800;">$TOBACKUP</span> <span style="color: #007800;">$TOEXCLUDE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> gpg <span style="color: #660033;">--symmetric</span> <span style="color: #660033;">--bzip2-compress-level</span> <span style="color: #000000;">9</span> <span style="color: #660033;">--passphrase</span> <span style="color: #800000;">${BACKUPPASS}</span>  <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
		<span style="color: #007800;">VAR_EXTENSION</span>=<span style="color: #ff0000;">&quot;.tar.bz2&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cf</span> - <span style="color: #007800;">$TOBACKUP</span> <span style="color: #007800;">$TOEXCLUDE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #660033;">-c</span> <span style="color: #660033;">--best</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPHOST</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPUSER</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPPASS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Save backup on FTP server</span>
		ncftpput <span style="color: #660033;">-u</span> <span style="color: #007800;">$FTPUSER</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$FTPPASS</span> <span style="color: #007800;">$FTPHOST</span> <span style="color: #007800;">$OUTDIR</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Save backup lokal</span>
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Delete temporary files</span>
	<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>		
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">else</span>	
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error: Output dir is empty&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span> 
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div><p>Der Name des komprimierten Backups setzt sich wie folgt zusammen: %Präfix%%Jahr%-%Monat%-%Tag%-%Stunde%-%Minute%-%Sekunde%.tar.bz2. Die Log Datei des Scripts findest du unter /var/log/%Präfix%backup.log. Enthalten sind dort Statistiken und Fehler zur FTP Übertragung sowie kritische Konfigurationsfehler.</p><p>Im Script werden Prozess und I/O Priorität angepasst um den Server nicht an seiner regulären Arbeit zu hindern. Beachte dabei das ein Ausführen von nice nur mit root Rechten möglich ist.</p><p>Mögliche Probleme mit Paketabhängigkeiten sollten sich nach dem erfolgreichen ausführen dieses Befehls erledigt haben:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ncftp <span style="color: #c20cb9; font-weight: bold;">bzip2</span> gnupg</pre></div></div><p>Sowohl date als auch tar, nice, ionice dpkg und mysql / mysqldump sind normalerweise auf dem Server vorhanden.</p><p>Bei Fragen oder Problemen scheue nicht die Kommentarfunktion zu verwenden.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Linux: Umount &#8211; device is busy</title><link>http://www.monkey-business.biz/484/linux-umount-device-is-busy/</link> <comments>http://www.monkey-business.biz/484/linux-umount-device-is-busy/#comments</comments> <pubDate>Sat, 30 Jan 2010 13:12:49 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Umount]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=484</guid> <description><![CDATA[Wer kennt das nicht: :~$ umount /media/disk/ umount: /media/disk: device is busy &#8220;device is busy&#8221; &#8211; Der Wechseldatenträger lässt sich nicht aushängen, weil er gerade noch von einem Programm in Benutzung ist. Die Umount Option -f führt nicht zum Ziel. Auch wenn -f für &#8220;force&#8221; steht. Den Datenträger dennoch auszuhängen ist folgendermaßen möglich: :~$ umount [...]]]></description> <content:encoded><![CDATA[<p>Wer kennt das nicht:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:~$ <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>disk<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">umount</span>: <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>disk: device is busy</pre></div></div><p>&#8220;device is busy&#8221; &#8211; Der Wechseldatenträger lässt sich nicht aushängen, weil er gerade noch von einem Programm in Benutzung ist. Die Umount Option -f führt nicht zum Ziel. Auch wenn -f für &#8220;force&#8221; steht. Den Datenträger dennoch auszuhängen ist folgendermaßen möglich:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:~$ <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk</pre></div></div><p>In der Manpage steht zur Option -l:</p><blockquote><p>&#8220;-l Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all refer* ences to the filesystem as soon as it is not busy anymore. (Requires Kernel 2.4.11 or later.)&#8221;</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/484/linux-umount-device-is-busy/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: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 7/14 queries in 0.010 seconds using disk: basic

Served from: www.monkey-business.biz @ 2012-02-05 02:09:23 -->
