<?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>Smemorando &#187; Script Bash</title>
	<atom:link href="http://www.smemorando.com/category/scritbash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smemorando.com</link>
	<description>loro ci vorrebbero tutti schiavi ma noi resistiamo</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:02:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Email all&#8217;accesso di root</title>
		<link>http://www.smemorando.com/2010/10/email-allaccesso-di-root/</link>
		<comments>http://www.smemorando.com/2010/10/email-allaccesso-di-root/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 10:19:07 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[Script Bash]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[relayhost]]></category>
		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://www.smemorando.com/?p=501</guid>
		<description><![CDATA[vim /root/.bashrc ## aggiungo alla fine se sul mio sistema è installato postfix cambio le righe del suo file di configurazione come segue. il mio /etc/postfix/mail.cf è stato modificato così: # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. [...]]]></description>
			<content:encoded><![CDATA[<p>vim /root/.bashrc</p>
<p>## aggiungo alla fine</p>
<pre class="qoate-code">
echo ‘Notifica di accesso con utente ROOT al sistema XXXX avvenuto il giorno (‘ `date -R` “) e proveniente dall’indirizzo ip “`who | cut -d”(” -f2 | cut -d”)” -f1` | mailx -s “Alert NOME-SERVER: Accesso con utente Root dall’ip  `who | cut -d”(” -f2 | cut -d”)” -f1`” indirizzo-email@dominio.xx
</pre>
<p>se sul mio sistema è installato postfix cambio le righe del suo file di configurazione come segue.</p>
<p>il mio /etc/postfix/mail.cf è stato modificato così:<br />
# Debian specific:  Specifying a file name will cause the first<br />
# line of that file to be used as the name.  The Debian default<br />
# is /etc/mailname.<br />
#myorigin = /etc/mailname</p>
<p>smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)<br />
biff = no</p>
<p># appending .domain is the MUA&#8217;s job.<br />
append_dot_mydomain = no</p>
<p># Uncomment the next line to generate &#8220;delayed mail&#8221; warnings<br />
#delay_warning_time = 4h</p>
<p>readme_directory = no</p>
<p># TLS parameters<br />
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem<br />
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key<br />
smtpd_use_tls=yes<br />
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache<br />
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache</p>
<p># See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for<br />
# information on enabling SSL in the smtp client.</p>
<p>myhostname = <span style="text-decoration: line-through;"><em>my-server<br />
</em></span>alias_maps = hash:/etc/aliases<br />
alias_database = hash:/etc/aliases<br />
myorigin = /etc/mailname<br />
mydestination =  localhost<br />
relayhost = <em><span style="text-decoration: line-through;">111.111.111.111</span></em>  ## indirizzo relay di posta<br />
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128<br />
mailbox_size_limit = 0<br />
recipient_delimiter = +<br />
inet_interfaces = all</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smemorando.com/2010/10/email-allaccesso-di-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script archive per TSM Client su linux</title>
		<link>http://www.smemorando.com/2010/02/script-per-tsm-client-su-linux/</link>
		<comments>http://www.smemorando.com/2010/02/script-per-tsm-client-su-linux/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:37:24 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Script Bash]]></category>
		<category><![CDATA[dsmc]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.smemorando.com/?p=413</guid>
		<description><![CDATA[Questo script da salvare in un file con estensione .sh e rendere eseguibile permette di cancellare il file x (exp_26022010.gz) generato ogni giorno presente sul disco locale solo dopo aver accertato che l&#8217;operazione di backup del client TSM non ha restituito errori. vim mioscript.sh se qualcuno vuole prendere spunto da quanto scrivo lo fa a [...]]]></description>
			<content:encoded><![CDATA[<p>Questo script da salvare in un file con estensione .sh e rendere eseguibile permette di cancellare il file x (exp_26022010.gz) generato ogni giorno presente sul disco locale solo dopo aver accertato che l&#8217;operazione di backup del client TSM non ha restituito errori.</p>
<p><strong>vim mioscript.sh</strong></p>
<pre class="qoate-code">
#inizio script
#!/bin/sh
rc=0

DATEOLD=`date --date yesterday "+%d-%m-%Y"`

cd /opt/tivoli/tsm/client/ba/bin/dsmc arc /backup/export/* &gt; /dev/null 2&gt; 1

rc=$?

if [ $rc -eq 0 ]; then

rm -rf /archivio/exp_?-$DATEOLD.gz

fi
#fine script
</pre>
<p>se qualcuno vuole prendere spunto da quanto scrivo lo fa a suo rischio e pericolo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smemorando.com/2010/02/script-per-tsm-client-su-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizzare l&#8217;SCP in un ciclo FOR</title>
		<link>http://www.smemorando.com/2010/01/utilizzare-lscp-in-un-ciclo-for/</link>
		<comments>http://www.smemorando.com/2010/01/utilizzare-lscp-in-un-ciclo-for/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 18:34:52 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[Script Bash]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[scp]]></category>

		<guid isPermaLink="false">http://www.smemorando.com/?p=363</guid>
		<description><![CDATA[creo un nuovo file con estenzione .sh sulla mia distribuzione linux preferita root@uby:/home# vi mioscript.sh e ci metto dentro quello che segue: con chmod aggiungo i permessi rwx per l&#8217;owner e per il gruppo: chmod 770 mioscript.sh]]></description>
			<content:encoded><![CDATA[<div lang="IT">
<p>creo un nuovo file con estenzione .sh sulla mia distribuzione linux preferita</p>
<p>root@uby:<strong><span style="text-decoration: underline;">/home# vi mioscript.sh</span></strong></p>
<p>e ci metto dentro quello che segue:</p>
<div>
<pre class="qoate-code">
#!/bin/bash
for d in 2 3 4 5 6
do
ls /home/FILE/*.jsp &gt; elenco-files.txt
for f in $(cat elenco-files.txt)
do scp /home/FILE/$f root@node$d:/home/FILE/ 2&gt;/dev/null
s2=$?
if [ $s2 -eq 0 ]
then
echo il “file” $f è stato trasferiti con successo sul nodo$d
else
echo il “file” $f NON è stato trasferiti con successo sul nodo$d
fi
done
</pre>
</div>
<div>con chmod aggiungo i permessi rwx per l&#8217;owner e per il gruppo:</div>
<div>chmod 770 <strong><span style="text-decoration: underline;">mioscript.sh</span></strong></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.smemorando.com/2010/01/utilizzare-lscp-in-un-ciclo-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

