<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>cron &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/cron/</link>
	<description>Feed of posts on WordPress.com tagged "cron"</description>
	<pubDate>Thu, 21 Aug 2008 02:08:42 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Lynx &amp; Cron untuk update RSS di Drupal CMS]]></title>
<link>http://antodoroki.wordpress.com/?p=96</link>
<pubDate>Tue, 19 Aug 2008 09:32:06 +0000</pubDate>
<dc:creator>antodoroki</dc:creator>
<guid>http://antodoroki.wordpress.com/?p=96</guid>
<description><![CDATA[Melanjutkan tulisan diblog ini sebelumnya tentang cron, sekarang saya akan coba berikan salah satu c]]></description>
<content:encoded><![CDATA[<p><a href="http://antodoroki.files.wordpress.com/2008/08/lynx.png"><img class="alignleft size-medium wp-image-98" style="border:1px solid black;margin:5px 10px;" src="http://antodoroki.wordpress.com/files/2008/08/lynx.png?w=300" alt="" width="270" height="137" /></a>Melanjutkan tulisan diblog ini sebelumnya tentang <a title="Cron" href="http://antodoroki.wordpress.com/2008/08/16/cron-untuk-penjadwalan-eksekusi-program/" target="_blank">cron</a>, sekarang saya akan coba berikan salah satu contoh penggunaan cron untuk penjadwalan eksekusi program.</p>
<p>Belum lama ini saya habis mendeploy sebuah situs intranet sederhana yang berbasis <a title="Drupal CMS" href="http://drupal.org" target="_blank">drupal CMS</a>. Situsnya sederhana aja, ada download file, shoutbox, comment dan beberapa fasilitas lainnya yang standar web jaman sekarang. Masalahnya saya ingin menambahkan RSS Aggregator untuk menampilkan berita terbaru dari <a href="http://www.detik.com">detik.com</a> dan <a href="http://www.okezone.com">okezone.com</a> di situs tersebut seperti halnya pada blog ini.</p>
<p>Jawabannya gampang aja, langsung masuk menu pengaturan RSS, copy-paste alamat RSS dari kedua situs tersebut lalu aktifkan. Kan uda pernah buat di wordpress ini..lalu dimana masalahnya? Saya baru tau kemudian siang harinya... Ternyata isi RSSnya ga pernah diupdate, padahal udah diset otomatis 1 jam sekali update RSS. Ternyata plugin drupal yang saya pake blm bisa mengupdate RSS secara otomatis (ga tau kalo yang laen pada bisa, kn saya newbie bgt di drupal), akibatnya isi berita detik.com dan okezone.com di situs saya tidak up-to-date.<!--more--></p>
<p>Oke deh, nyari-nyari mekanisme update di drupal, ternyata dilakukan dengan mengakses kode php di alamat http://localhost/drupal/cron.php. Berarti ada di root direktori drupal yang diinstall. Setiap saya membuka page ini secara manual di browser, dan kebetulan pada saat itu sudah ada berita baru di detik.com, langsung RSS Aggregatornya terupdate. Berarti satu jam sekali harus buka alamat ini donk... Dari alamat cron.php saya jadi teringat si cron yg baru dibahas di blog ini. Kita bisa minta tolong ga sama cron untuk bukain page ini setiap jam, daripada saya yang capek buka-bukaan ?</p>
<p>Ga masalah, cron emang diciptakan untuk penjadwalan. Masalahnya sekarang yang mo dijadwalin apa? Kan servernya non GUI, text based. Mana ada firefox didalamnya, untuk buka halaman web. Untung inget sama paket dasarnya CentOS, yang ada text-based web browser. Jadi di linux itu ada program yang namanya <a title="Lynx" href="http://en.wikipedia.org/wiki/Lynx_(web_browser)" target="_blank">Lynx</a>, yang bisa digunakan untuk mengakses web dari terminal. Gunanya untuk mengecek kompabilitas situs dengan browser lama, maupun untuk mengakses situs pada komputer yg 'amat-sangat-lemot' atau bandwidthnya yang 'amat-sangat-lemot' sampe ga kuat buat nampilin gambar. Dari definisinya yg text-based aja uda bisa ketauan klo browser ini ga bisa nampilin gambar. Tapi ga masalah, orang butuhnya cuma panggil halaman cron.php yang itupun ga ada isinya. Cuma mengaktifkan fungsi update RSS.</p>
<p>Langsung aja daftarkan si Lynx di crontab, kayak gini nih:</p>
<pre>0 * * * * lynx -dump http://localhost/drupal/cron.php</pre>
<p>Artinya adalah menjalankan program lynx setiap jam untuk membuka halaman http://localhost/drupal/cron.php. parameter dump dari lynx digunakan untuk mengabaikan hasil teks yang dikembalikan server saat diminta untuk mengakses cron.php. Toh kita hanya perlu memastikan bahwa fungsi update RSS sudah berjalan, tanpa perlu tau hasil updatenya seperti apa. Mengenai arti 0 * * * * adalah yang menetukan bahwa proses eksekusi dijadwalkan setiap jam. Untuk parameter yang dikenali oleh cron dapat dibaca di posting sebelumnya tentang <a title="Tentang Cron" href="http://antodoroki.wordpress.com/2008/08/16/cron-untuk-penjadwalan-eksekusi-program/" target="_blank">cron</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cron и AJAX в App Engine]]></title>
<link>http://techworkru.wordpress.com/?p=224</link>
<pubDate>Fri, 15 Aug 2008 15:52:58 +0000</pubDate>
<dc:creator>techworkru</dc:creator>
<guid>http://techworkru.wordpress.com/?p=224</guid>
<description><![CDATA[В этой статье мы рассмотрим дополнительные сервисы, ко]]></description>
<content:encoded><![CDATA[<p>В этой статье мы рассмотрим дополнительные сервисы, которые реализованы сторонними разработчиками, но очень пригодятся для воплощения некоторых проектов.</p>
<p><strong>Сервис Cron </strong><br />
Иногда требуется через регулярные интервалы времени выполнять какие-то действия, к примеру удаление временных данных или обновление значений счетчиков. Этот сервис является простой надстройкой над утилитой <em>wget,</em> которая обращается по заданному URL в определенное время.</p>
<ul>
<li><a href="http://movq.net/#cron-service" target="_blank">Черновая документация по сервису Cron<br />
</a></li>
</ul>
<p><strong>Сервис Comet</strong><br />
А это, как говорится, мой любимый. Представьте, что необходимо создать приложение-чат на Google App Engine. Самый простейший способ, который вспомнят ветераны веб-строения - использование долгоиграющих HTTP запросов и потоковая выдача данных от сервера, который будет сообщать об новых событиях. Однако на платформе App Engine такой вариант неприменим по ряду архитектурных ограничений. Имеются другие варианты оперативного взаимодействия с сервером, один из которых можно взять на вооружение - использование на клиентской части<br />
XMLHttpRequest запросов. В английском языке существует даже неологизм, связанный с набором таких технологий - <a href="http://en.wikipedia.org/wiki/Comet_(programming)" target="_blank">Comet</a>.</p>
<p>Теперь давайте подсчитаем: Google выделяет квоту 650 тысяч HTTP запросов в день. Допустим, что мы будем опрашивать сервер каждую секунду.</p>
<p><em>650k запросов в день / 86k секунд в день = 7 пользователей могут быть в чате целый день<br />
</em></p>
<p>Согласитесь, что 7 пользователей для масштабируемого приложения не являются достойным показателем. Описываемый сервис Comet позволяет преодолеть эти ограничения и не иметь проблем с дополнительным сервером.</p>
<p>Главным ограничением его использования является то, что вы должны иметь собственный домен для работы приложения. К сожалению, сервис не поддерживает работу сайтов в зоне <em>*.appspot.com</em>.</p>
<ul>
<li><a href="http://test.movq.net/shoutbox/" target="_blank">Пример чата (опубликован на GAE)</a></li>
<li><a href="http://test.movq.net/usercounter/" target="_blank">Простой пример интерактивного подсчета посетителей<br />
</a></li>
<li><a href="http://movq.net/#comet-daemon-service" target="_blank">Черновая документация по сервису Comet<br />
</a></li>
</ul>
<p><strong>Итог</strong><br />
Ну и конечно все примеры можно загрузить <a href="http://code.google.com/p/gae-services-examples/source/browse" target="_blank">в исходных кодах</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[crontab cannot find my perl modules]]></title>
<link>http://contekanku.wordpress.com/?p=5</link>
<pubDate>Thu, 07 Aug 2008 13:25:46 +0000</pubDate>
<dc:creator>likenoothers</dc:creator>
<guid>http://contekanku.wordpress.com/?p=5</guid>
<description><![CDATA[Today I experienced a problem running my perl script using crontab. The perl script used DBI module ]]></description>
<content:encoded><![CDATA[<p>Today I experienced a problem running my perl script using crontab. The perl script used DBI module to perform query and insertion to an Oracle DB.</p>
<p>The perl script run well when it is directly accessed in terminal using current user. But when I tried to execute it from crontab, it fails.</p>
<p>Firstly I thought it failed because the file access error (my script tried to write to a file), but after some investigation it was caused by the missing module. I wonder why..... The DBI module cannot be found in one of the path specified in @INC variables.</p>
<p>Here are my investigation.<br />
<strong>1. I tried to access the perl script from a bash script (/bin/sh). It still failed.</strong><br />
Here is the bash script.<br />
<code>#updateDB.sh<br />
#!/bin/sh<br />
cd /home/me/<br />
./updateDB.pl</code></p>
<p><code></code><br />
<strong> 2. I need to know what is the crontab log.</strong><br />
The crontab log must have the necessary information about the failure. But I found the crontab does not have the log. I must create log for each cron jobs. So I call the cron job this way<br />
0 * * * * /home/me/updateDB.sh &#62;&#62; /home/me/cronlog/log.txt &#62; /dev/null &#62; 2&#62;&#38;1<br />
/home/me/cronlog/log.txt is the log file.<br />
I found out that some modules I used in the perl script cannot be found when the perl script is scheduled as cron jobs. I wonder why...<br />
<em>Note: the /dev/null &#62; 2&#62;&#38;1 is used to avoid the cron to send email after executing the cron job</em></p>
<p><em></em><br />
<strong>3. So why cron cannot find the module, while in normal execution (through terminal), it run well?</strong><br />
I want to know the @INC in cron execution environment and compared it to normal execution.<br />
I add 1 cron job to print the perl @INC.<br />
0 * * * * perl -e "print join(\"\n\", @INC);" &#62;&#62; /home/me/cronlog/log.txt &#62; /dev/null &#62; 2&#62;&#38;1<br />
It shows the @INC is different compared to the normal execution. Then I found that the shell environment variables must be loaded prior to perl execution in cron job schedule.<br />
I finally modified the updateDB.sh like this:<br />
<code><br />
#!/bin/csh<br />
cd /home/me/<br />
source ./.cshrc<br />
perl /home/me/updateDB.pl<br />
</code><br />
I run the cshell script in the cron schedule, and my perl script works fine.</p>
<p>My system happens to use cshell as it's shell environment. In that case, we use .cshrc instead of .bashrc.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Automatically update Ubuntu Hardy Heron server with a ruby script]]></title>
<link>http://lani78.wordpress.com/?p=10</link>
<pubDate>Wed, 06 Aug 2008 20:58:18 +0000</pubDate>
<dc:creator>lani78</dc:creator>
<guid>http://lani78.wordpress.com/?p=10</guid>
<description><![CDATA[Needs
I wanted my newly installed Ubuntu server to check for updates every day and then automaticall]]></description>
<content:encoded><![CDATA[<p><strong>Needs</strong></p>
<p>I wanted my newly installed <a href="http://www.ubuntu.com/products/WhatIsUbuntu/serveredition" target="_blank">Ubuntu server</a> to check for updates every day and then automatically update itself if there were any new updates found. I search the web trying to find an existing solution that would work out of the box for me. But I am of course very picky of what I want, so I could not found anything that met all my needs:</p>
<ul>
<li>Automatically check for updates every day.</li>
<li>Automatically download and install any updates that were found.</li>
<li>Report both success and failures to my e-mail and show me in the subject if the update failed or succeeded.</li>
<li>Use an external smtp-server with authentication.</li>
</ul>
<p>As I am also trying to learn the <a href="http://www.ruby-lang.org/en/" target="_blank">Ruby programming language,</a> besides from Linux, I decided to use it to create my update script.</p>
<p><strong>Installing Ruby</strong></p>
<p>Ruby is not installed by default on Hardy Heron but can easily be installed from the Ubuntu repositories:</p>
<p><code>sudo apt-get install ruby</code></p>
<p><strong>The Script</strong></p>
<pre><font face="courier new">
#!/usr/bin/ruby
##### Information ##############################################
# DESC:	This is an update script for Ubuntu Hardy Heron 8.04.
#	It will fetch any availible updates with aptitude and
#	install them. An e-mail with the result is then sent
#	using the configured smtp-server.
# AUTH:	Niklas "Lani" Lagergren
# REV.:	1.0 2008-08-06
#	* Initial release.
#
# COPY: No copyright claimed. No rights reserved. No warranty
#       given.
################################################################</code>

##### Configurable mail server options: ########################
# These parameters needs to be changed to match your enviorment
################################################################
@mail_server = 'your.mail-server.com'
@mail_port   = 25
@mail_domain = 'your.mail-domain.com'
@mail_user   = 'username'
@mail_pass   = 'password'
@mail_from   = 'from@your.mail-domain.com'
@mail_to     = 'to@somewhere.nil'

require 'net/smtp'

# Format date according to rfc 2822, example:
# Fri, 11 Jul 2008 09:13:20 +0200
def time_to_rfc2822(time)
  time.strftime('%a, %d %b %Y %H:%M:%S ') +
    if time.utc?
      '-0000'
    else
      off = time.utc_offset
    sign = off &#60; 0 ? '-' : '+'
    format('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
  end
end

# Send e-mail according to the configuration in the instance variables.
def send_mail(subject, body)
  msg = "From: Ubuntu Server &#60;#{@mail_from}&#62;\r\n" +
    "To: Server Administrator &#60;#{@mail_to}&#62;\r\n" +
    "Subject: #{subject}\r\n" +
    "Date: #{time_to_rfc2822(Time.new)}\r\n" +
    "Message-Id: &#60;#{Time.new}@#{@mail_domain}&#62;\r\n" +
    "\r\n#{body}\r\n"

    Net::SMTP.start(@mail_server, @mail_port, @mail_domain, @mail_user,
      @mail_pass) do &#124;smtp&#124;
      smtp.send_message msg, @mail_from, @mail_to
    end
end

# Run aptitude commands to update the system and capture it's output.
puts 'Running aptitude...'
body = `aptitude update 2&#62;&#38;1`
body &#60;&#60; `aptitude dist-upgrade -y 2&#62;&#38;1` if $? == 0
body &#60;&#60; `aptitude clean 2&#62;&#38;1` if $? == 0

subject = "#{@mail_domain} update #{$? == 0 ? 'succeded' : 'FAILED'} #{Time.new}"

puts 'Sending mail...'
send_mail subject, body
puts 'Mail sent.'
</font>
</pre>
<p><strong>Set the script to run every day</strong><br />
Obviously you need to change the mail settings in the script as the comment suggest. Then save the script, I named it <em>"autoupdate"</em>. To run the script on a daily basis copy it to <em>"/etc/cron.daily"</em>. And don't forget to set execute permissions on the script (and as I have the password stored in the file I also removed all <a href="http://www.zzee.com/solutions/linux-permissions.shtml" target="_blank">permissions</a> from <em>"others"</em>:<br />
<code><br />
sudo chmod 770 autoupdate<br />
</code></p>
<p><strong>Test the script</strong><br />
The easiest way to test the script is of course to just execute it:<br />
<code>sudo ./autoupdate</code></p>
<p>If you really want to make sure that it will execute when executed in the same way as when execute by the cron job you could run:</p>
<p><code>sudo run-parts /etc/cron.daily</code></p>
<p>Note that this will execute all scripts in the cron.daily folder. Another side note is that it probably won't  run with the same permissions as when executed from the cron job, and it will probably take a long time to execute.</p>
<p>Now check your mailbox or the log files for the result:</p>
<p><code>cat /var/log/aptitude</code></p>
<p>Hopefully someone out there can benefit from this script as it is, or if you're like me; tweak it to suite your own needs ;)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zap2xml - TV listings for Mythtv]]></title>
<link>http://jesusdemontreal.wordpress.com/?p=70</link>
<pubDate>Mon, 04 Aug 2008 06:29:07 +0000</pubDate>
<dc:creator>jesusdemontreal</dc:creator>
<guid>http://jesusdemontreal.wordpress.com/?p=70</guid>
<description><![CDATA[TV Schedule : I don’t like paying for stuff so I installed zap2xml (see website). I know for a fac]]></description>
<content:encoded><![CDATA[<p>TV Schedule : I don’t like paying for stuff so I installed zap2xml (see <a href="http://zap2xml.110mb.com/">website</a>). I know for a fact that it works in the US (haven’t tried though) and also in Canada (where i am)<br />
<em><strong></strong></em></p>
<p><em><strong>There’s one issue that needs to be watched - Zap2it.com (the website that provides the schedule data) sometimes changes its layout which in turn breaks zap2xml script. If you end up with issues on your TV schedule, pay a visit to zap2xml <a href="http://zap2xml.110mb.com/">website</a> to see if a script update is available</strong></em></p>
<p>I built a script that automatically downloads the schedule and run mythfilldatabase to update the listing. I failed trying to add the script to a cron job (the script will start but will never finish for some reason) (I strongly suggest you make a separate folder for zap2xml and this script, in this exemple it’ll be called /zap2xml</p>
<blockquote><p>#!/bin/bash<br />
#updatelisting.sh<br />
cd /zap2xml<br />
rm ./xmltv.xml<br />
rm -rf ./cache/<br />
./zap2xml.pl -u <strong><em>username</em></strong> -p <strong><em>password</em></strong> -d 14 -e<br />
mythfilldatabase –refresh-all –file <strong>1</strong> xmltv.xml</p></blockquote>
<p>I happened to understand that for some reason this script was generating to much output for cron. I just modified it to make it a silent script. There's been two other modifications, one is to run zap2xml and mythfilldatabase with a nice value of 15 (ok, it takes forever to run but since it's in the background and helps not to get glitches during my recordings... those of you with good hardware can remove that part) and it now downloads four days of data 10 days from now to release some of the workload on the machine since I'll be running it everyday from now on.</p>
<blockquote><p>#!/bin/bash<br />
#quietupdate.sh<br />
cd /home/dom/bin/xmltv<br />
rm ./xmltv.xml<br />
rm -rf ./cache/<br />
nice -n +15 ./zap2xml.pl -d 4 -s 10 -q -u <strong>username</strong> -p <strong>password</strong> -e<br />
nice -n +15 mythfilldatabase --refresh-all --file <strong>1</strong> xmltv.xml &#62;&#62; /dev/null</p></blockquote>
<p>Now all that's left is to add it to your crontab by running</p>
<blockquote>
<p style="padding-left:30px;">crontab -e</p>
</blockquote>
<p>and type in</p>
<blockquote>
<p style="padding-left:30px;"># m h  dom mon dow   command<br />
0 0 * * * <strong>/path/to/your/</strong>quietupdate.sh</p></blockquote>
<p>Now save and exit the text editor and you should be on your way. By the way, it is mandatory to run the first script at least once in order for the second one to run properly (just once, not everytime)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cygwin, cron / crontab, cron-config 사용기.]]></title>
<link>http://lum7671.wordpress.com/2008/07/24/cygwin-cron-crontab-cron-config-%ec%82%ac%ec%9a%a9%ea%b8%b0/</link>
<pubDate>Thu, 24 Jul 2008 04:46:49 +0000</pubDate>
<dc:creator>lum7671</dc:creator>
<guid>http://lum7671.wordpress.com/2008/07/24/cygwin-cron-crontab-cron-config-%ec%82%ac%ec%9a%a9%ea%b8%b0/</guid>
<description><![CDATA[이전 문서를 뒤져서 &#8220;Cygwin, cron / crontab 사용하기&#8221;를 적었는데 이게 ]]></description>
<content:encoded><![CDATA[<p>이전 문서를 뒤져서 <a href="http://lum7671.wordpress.com/2008/07/23/cygwin-cron-crontab-%ec%82%ac%ec%9a%a9%ed%95%98%ea%b8%b0/">"Cygwin, cron / crontab 사용하기"</a>를 적었는데 이게 오래된 것이고 회사에서 AD 시스템을 사용하기 때문에 일반적으로 사용하는 설정으로 되지 않았다.</p>
<p>/usr/bin/cron-config : 자동으로 Windows Service에 등록해주는 명령이다.<br />
/usr/bin/cygrunsrv : Windows Service 관련 된 Cygwin 명령이다.<br />
/usr/bin/cronevents : Cron 관련 event log 보는 프로그램이다.</p>
<p>[그림 1] cron-config 실행 화면<br />
<a href="http://lum7671.files.wordpress.com/2008/07/cygwin-cron03.png"><img class="aligncenter size-medium wp-image-99" src="http://lum7671.files.wordpress.com/2008/07/cygwin-cron03.png" alt="" /></a><br />
빨간 네모는 이미 설치가 되있으면 나오는 메시지이다.</p>
<p>[그림 2] cronevents 실행 화면<br />
<a href="http://lum7671.files.wordpress.com/2008/07/cygwin-cronevents01.png"><img class="aligncenter size-medium wp-image-99" src="http://lum7671.files.wordpress.com/2008/07/cygwin-cronevents01.png" alt="" /></a></p>
<p><strong>[참고] cron 실행계정 만들어 보안 높이기</strong><br />
<em>(여기서는 cron_server 로 하겠음)</em></p>
<ol>
<li>cron_server 계정 만들기<br />
<code>$ net user cron_server &#60;passwd&#62; /add /yes<br />
$ net localgroup &#60;administrators group name&#62; cron_server /add</code><br />
<em>&#60;passwd&#62; : cron_server 계정에 쓸 비밀번호.<br />
&#60;administrators group name&#62; : 보통 Administrators 임.</em></li>
<li>cron_server 계정 권한 설정<br />
<code>$ editrights -a SeAssignPrimaryTokenPrivilege -u cron_server<br />
$ editrights -a SeCreateTokenPrivilege -u cron_server<br />
$ editrights -a SeIncreaseQuotaPrivilege -u cron_server<br />
$ editrights -a SeServiceLogonRight -u cron_server<br />
$ mkpasswd -l -u cron_server &#62;&#62; /etc/passwd</code></li>
<li>보안 높이기<br />
cron_server계정은 로그인 못하도록 설정<br />
<code>$ editrights -a SeDenyInteractiveLogonRight -u cron_server<br />
$ editrights -a SeDenyNetworkLogonRight -u cron_server<br />
$ editrights -a SeDenyRemoteInteractiveLogonRight -u cron_server</code></li>
<li>윈도즈 서비스에 등록<br />
<code>$ cygrunsrv -I cron -p /usr/sbin/cron -a -D -u cron_server -w &#60;passwd&#62;</code><br />
<em>만약, cron 이 이미 등록돼 있으면 다음 명령으로 기존 cron 서비스를 지우고 서비스를 등록함.<br />
<code>$ cygrunsrv -E cron<br />
$ cygrunsrv -R cron</code></em></li>
</ol>
<p>참고사이트 :<br />
<a href="http://www.mail-archive.com/cygwin@cygwin.com/msg31538.html">http://www.mail-archive.com/cygwin@cygwin.com/msg31538.html</a></p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/a582703d-67ab-4cef-92b4-5465903cf6f6/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=a582703d-67ab-4cef-92b4-5465903cf6f6" alt="Zemanta Pixie" /></a></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Wordpress環境の自動バックアップとリストアのテスト]]></title>
<link>http://yakitech.wordpress.com/2008/07/23/wordpress%e7%92%b0%e5%a2%83%e3%81%ae%e8%87%aa%e5%8b%95%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97%e3%81%a8%e3%83%aa%e3%82%b9%e3%83%88%e3%82%a2%e3%81%ae%e3%83%86%e3%82%b9%e3%83%88/</link>
<pubDate>Wed, 23 Jul 2008 10:12:34 +0000</pubDate>
<dc:creator>tenu</dc:creator>
<guid>http://yakitech.wordpress.com/2008/07/23/wordpress%e7%92%b0%e5%a2%83%e3%81%ae%e8%87%aa%e5%8b%95%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97%e3%81%a8%e3%83%aa%e3%82%b9%e3%83%88%e3%82%a2%e3%81%ae%e3%83%86%e3%82%b9%e3%83%88/</guid>
<description><![CDATA[ほぼこちらを丸パクリでバックアップスクリプト作って、wordpressサーバー]]></description>
<content:encoded><![CDATA[<p>ほぼこちらを丸パクリでバックアップスクリプト作って、wordpressサーバーの定期バックアップ設定をしました。</p>
<p>自動バックアップ運用(tar+GnuPG+rsync/ftp) - CentOSで自宅サーバー構築<br>http://centossrv.com/backup.shtml
<p>バックアップ対象にしたデータは以下の通りです。</p>
<ul>
<li>Wordpress関係のファイルすべて</li>
<li>httpd.conf</li>
<li>MySQLのデータベースをダンプしたもの</li>
</ul>
<p>データベースのダンプも自動です。これらをFTP経由でWindowsのサーバーにコピります。</p>
<p>システムのバックアップは本番運用前にGhost取っときます。</p>
<p>バックアップしたならリストアもせねばということで、VM上で復旧テストしました。FQDNをあちこちで使ってるので、本番サーバーにリダイレクトされてしまって復旧したかどうか分かりにくかったんですが、VM環境でネットワーク閉じてVM上のクライアントにhosts書いてテストして確認しました。</p>
<p>今回は丸パクリで出来ましたが、自分でスクリプト書いてcronに登録とかって自分でするのは中々遠き道のりになりそうです。</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Шедулер в cisco IOS]]></title>
<link>http://mschedrin.wordpress.com/?p=106</link>
<pubDate>Tue, 22 Jul 2008 09:12:46 +0000</pubDate>
<dc:creator>mschedrin</dc:creator>
<guid>http://mschedrin.wordpress.com/?p=106</guid>
<description><![CDATA[Оказывается в циске есть свой шедулер, довольно функци]]></description>
<content:encoded><![CDATA[<p>Оказывается в циске есть свой шедулер, довольно функциональный! Создание бэкапа на базе cisco kron показано ниже.<br />
<code>kron policy-list backup-config<br />
 cli copy running-config tftp://88.201.x.x/<br />
kron occurrence backup-test at 13:10 oneshot<br />
 policy-list backup-config<br />
</code><br />
Единоразово зальет конфиг на tftp.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[updatedb в kubuntu]]></title>
<link>http://blickfeld.wordpress.com/?p=18</link>
<pubDate>Thu, 03 Jul 2008 11:14:36 +0000</pubDate>
<dc:creator>blickfeld</dc:creator>
<guid>http://blickfeld.wordpress.com/?p=18</guid>
<description><![CDATA[Едно дразнещо нещо забелязах в Кубунту и то е, че всеки ]]></description>
<content:encoded><![CDATA[<p>Едно дразнещо нещо забелязах в <strong>Кубунту</strong> и то е, че всеки ден се пуска <strong>updatedb</strong> без аз да съм поискал това. Аз не използвам толкова често locate за да имам нужда от актуално състояне на базата от данни на <strong>locate</strong>. А и когато ми се наложи да търся винаги мога преди това да си я update-на ръчно, вярно е че ше стане по-бавно, но аз предпочитам този начин. Това със сигурност беше някакъв крон, порових се малко в интернет и открих начин да му оказвам да се пуска месечно. единственото което трабва да се направи е да се премести крона за <strong>updatedb</strong> от дневно изпъленение на месечно изпълнение:</p>
<blockquote><p>cd /etc/cron.daily</p>
<p>sudo mv slocate ../cron.monthly/</p></blockquote>
<p>Това е :)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Don't get pwned like we did!]]></title>
<link>http://lyricwiki.wordpress.com/?p=66</link>
<pubDate>Sun, 01 Jun 2008 02:23:23 +0000</pubDate>
<dc:creator>Sean Colombo</dc:creator>
<guid>http://lyricwiki.wordpress.com/?p=66</guid>
<description><![CDATA[Earlier this week we had some really strange errors on the site (detailed description here) that wer]]></description>
<content:encoded><![CDATA[<p>Earlier this week we had some really strange errors on the site (<a href='http://lyricwiki.wordpress.com/2008/05/29/the-promised-details-about-the-problems-from-earlier/'>detailed description here</a>) that were caused by a mySQL bug which will eventually burn anyone who is running master/slave replication.</p>
<p>I mentioned that you'd need to write a script to prevent this problem from happening to you.  The script would delete old, unneeded mySQL bin-log files.  In the spirit of stopping this bug from affecting others, I've released a generic version of the script... you just have to set up a few variables in the "configuration" section at the top of the script and you should be good to go.  For the code and info on how to make it run daily, see the "update" section of <strong><a href='http://www.seancolombo.com/2008/05/28/quick-tip-prune-your-log-files-if-you-use-mysql-replication/'>the post</a></strong> on my blog.  It is, of course, free and open source.</p>
<p>Hope that helps someone!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Detectando Intrusos en Linux - Parte II]]></title>
<link>http://julianrdz.wordpress.com/?p=90</link>
<pubDate>Thu, 29 May 2008 20:27:26 +0000</pubDate>
<dc:creator>Julián Rodríguez</dc:creator>
<guid>http://julianrdz.wordpress.com/?p=90</guid>
<description><![CDATA[chkrootkitLos crackers, suelen camuflar o sustituir en  ficheros binarios del sistema su propios fic]]></description>
<content:encoded><![CDATA[<p><strong>chkrootkit</strong>Los <strong>crackers</strong>, suelen camuflar o sustituir en  <strong>ficheros binarios</strong> del sistema su propios ficheros troyanos, algunos de los ejemplos típicos son:  login, su, telnet, netstat, ifconfig, ls, find, du, df, libc, sync, asi como los binarios listados en /etc/inetd.conf.<br />
Nosotros tenemos que verificar que tenemos la versión original de estos ficheros y no la versión troyanizada,  todo esto y mucho más lo podemos hacer usando el potente programa <a href="http://www.chkrootkit.org/">chkrootkit</a>, en la última versión disponible detecta troyanos en todos estos <strong>ficheros</strong>:<br />
aliens, asp, bindshell, lkm, rexedcs, sniffer, wted, z2, amd, basename, biff, chfn, chsh, cron, date, du, dirname, echo, egrep, env, find, fingerd, gpm, grep, hdparm, su, ifconfig, inetd, inetdconf, identd, killall, login, ls, mail, mingetty, netstat, named, passwd, pidof, pop2, pop3, ps, pstree, rpcinfo, rlogind, rshd, slogin, sendmail, sshd, syslogd, tar, tcpd, top, telnetd, timed, traceroute, write.</p>
<p>Siendo capaz de detectar los siguientes <strong>RootKits</strong>:<br />
Solaris rootkit, FreeBSD rootkit, lrk3, lrk4, lrk5, lrk6, t0rn (and t0rn v8), some lrk variants, Ambient's Rootkit for Linux (ARK), Ramen Worm, rh[67]-shaper, RSHA, Romanian rootkit, RK17, Lion Worm, Adore Worm, LPD Worm, kenny-rk, Adore LKM, ShitC Worm, Omega Worm, Wormkit Worm, dsc-rootkit.</p>
<p>Una vez compilados los programas (chkwtmp, chklastlog, chkproc, chkwtmp, ifpromisc) que utiliza el chkrootkit para realizar parte de sus trabajo (chkrootkit en sí mismo es un shell script), la utilización del mismo es bastante trivial.</p>
<pre># ./chkrootkit
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
Checking `echo'... not infected
Checking `egrep'... not infected
Checking `env'... not infected
Checking `find'... not infected
Checking `fingerd'... not found
Checking `gpm'... not infected
Checking `grep'... not infected
Checking `hdparm'... not infected
Checking `su'... not infected
Checking `ifconfig'... not infected
Checking `inetd'... 

....
</pre>
<p>Solo puede darse un problema (de muy facil solución como vamos a ver), y que consiste en que <strong>chkrootkit</strong>, al ser un shell script, se basa en las siguientes herramientas:<br />
awk, cut, echo, egrep, find, head, id, ls, netstat, ps, strings, sed, uname.<br />
que puede contener algun troyano, la solución nos la da el propio programa, por medio de un simple parametro, le indicaremos donde debe de buscar y ejecutar esos programas que necesita:<br />
Si los tenemos un CD-ROM:</p>
<pre>./chkrootkit -p /cdrom/bin
</pre>
<p>En caso de tener los binarios originales de la distribución en un diskette:</p>
<pre>./chkrootkit -p /floppy
</pre>
<p>En el caso que solo nos interese verificar algun determinado fichero lo indicaremos directamente, en este caso "ps", "login" y "sendmail".</p>
<pre># ./chkrootkit ps login sendmail
ROOTDIR is /'
Checking 's'... not infected
Checking 'login'... not infected
Checking 'sendmail'... not infected
</pre>
<p>Aqui tenemos todas las opciones disponibles en este interesante programa:</p>
<pre># ./chkrootkit --help
Usage: ./chkrootkit [options] [test ...]
Options:
        -h                show this help and exit
        -V                show version information and exit
        -l                show available tests and exit
        -d                debug
        -q                quiet mode
        -x                expert mode
        -r dir            use dir as the root directory
        -p dir1:dir2:dirN path for the external commands used by chkrootkit
</pre>
<p>Para verificar la alteración de los logs, usaremos los programas chkwtmp y chklastlog:</p>
<pre># ./chkwtmp
</pre>
<pre># ./chklastlog
</pre>
<p>Pudiendo testear incluso si la interfaz esta en modo promiscuo, lo que indicaria que tenemos algun sniffer funcionando:</p>
<pre>./ifpromisc
ppp0 is not promisc

<strong>Links y Referencias:</strong>
</pre>
<ul>
<li>How to tell if your Linux box has been cracked: <a href="http://www.linuxworld.com/site-stories/2001/1012.cracked.html"> http://www.linuxworld.com/site-stories/2001/1012.cracked.html</a></li>
<li>Unix Incident Guide: How to Detect an Intrusion. <a href="http://www.ciac.org/ciac/documents/CIAC-2305_UNIX_Incident_Guide_How_to_Detect_an_Intrusion.pdf"> http://www.ciac.org/ciac/documents/CIAC-2305_UNIX_Incident_Guide_How_to_Detect_an_Intrusion.pdf</a></li>
<li>Detección de Intrusos 1.0 (por J.J.F Team): <a href="http://www.aebius.com/b_datos_doc/archivos/deteccion_intrusos.htm"> http://www.aebius.com/b_datos_doc/archivos/deteccion_intrusos.htm</a></li>
<li>CERT's Detecting Signs of Intrusion: <a href="http://www.cert.org/security-improvement/modules/m09.html"> http://www.cert.org/security-improvement/modules/m09.html</a></li>
<li>CERT's  <a href="http://www.cert.org/tech_tips/unix_configuration_guidelines.html"> http://www.cert.org/tech_tips/unix_configuration_guidelines.html</a></li>
<li>CERT's  <a href="http://www.cert.org/tech_tips/intruder_detection_checklist.html"> http://www.cert.org/tech_tips/intruder_detection_checklist.html</a></li>
<li>CERT's  <a href="http://www.cert.org/tech_tips/root_compromise.html"> http://www.cert.org/tech_tips/root_compromise.html</a></li>
<li>FAQ: Network Intrusion Detection System. http://www.robertgraham.com/pubs/network-intrusion-detection.html</li>
<li>Help when broken into: <a href="http://www.fish.com/tct/help-when-broken-into"> http://www.fish.com/tct/help-when-broken-into</a></li>
<li>Computer Forensics Analysis Class Handouts: <a href="http://www.fish.com/forensics/class.html"> http://www.fish.com/forensics/class.html</a></li>
<li>Intrusion Detection FAQ: <a href="http://www.sans.org/newlook/resources/IDFAQ/ID_FAQ.htm"> http://www.sans.org/newlook/resources/IDFAQ/ID_FAQ.htm</a></li>
<li>chkrootkit (locally checks for signs of a rootkit): <a href="http://www.chkrootkit.org/"> http://www.chkrootkit.org/</a></li>
<li>RID (remote intrusion detector): <a href="http://www.theorygroup.com/Software/RID/"> http://www.theorygroup.com/Software/RID/</a></li>
<li>Know Your Enemy: A Forensic Analysis. <a href="http://project.honeynet.org/papers/forensics/"> http://project.honeynet.org/papers/forensics/</a></li>
<li>The DoS Project's "trinoo" distributed denial of service attack tool: <a href="http://staff.washington.edu/dittrich/misc/trinoo.analysis"> http://staff.washington.edu/dittrich/misc/trinoo.analysis</a></li>
<li>Know Your Enemy: Passive Fingerprinting. <a href="http://project.honeynet.org/papers/finger/"> http://project.honeynet.org/papers/finger/</a></li>
<li>"Root Kits" and hiding files/directories/processes after a break it: <a href="http://staff.washington.edu/dittrich/misc/faqs/rootkits.faq"> http://staff.washington.edu/dittrich/misc/faqs/rootkits.faq</a></li>
<li>Charla "Network Intrusion Detection Systems. Snort based NIDS": <a href="http://umeet.uninet.edu/conferencias/05-12-2000/0512.html"> http://umeet.uninet.edu/conferencias/05-12-2000/0512.html</a></li>
<li>Preparing to Detect Signs of Intrusion: <a href="http://www.arcert.gov.ar/webs/textos/intrusion.pdf"> http://www.arcert.gov.ar/webs/textos/intrusion.pdf</a></li>
<li>Intrusion Detection Methodologies: <a href="http://www.arcert.gov.ar/webs/textos/idmethods.pdf"> http://www.arcert.gov.ar/webs/textos/idmethods.pdf</a></li>
</ul>
<pre>
</pre>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Detectando Intrusos en Linux - Parte I]]></title>
<link>http://julianrdz.wordpress.com/?p=89</link>
<pubDate>Thu, 29 May 2008 02:35:21 +0000</pubDate>
<dc:creator>Julián Rodríguez</dc:creator>
<guid>http://julianrdz.wordpress.com/?p=89</guid>
<description><![CDATA[Cada día, hay más y más máquina conectadas a Intenet,  con el consiguiente aumento en la probabi]]></description>
<content:encoded><![CDATA[<p>Cada día, hay más y más máquina conectadas a <strong>Intenet</strong>,  con el consiguiente aumento en la probabilidad de sufrir un ataque por parte de <strong>crackers</strong>. El número de ataques reportados ha crecido espectacularmente con respecto a la cifra de años anteriores.<br />
¿Podemos estar tranquilos y seguros detrás de nuestro potente <a href="http://bulma.net/body.phtml?nIdNoticia=861">Firewall</a>?</p>
<p><strong>Linux</strong> es un sistema que potencialmente es muy <strong>seguro</strong>, pero necesita estar bien administrado, porque de otra forma puede ser la causa de númerosos problemas relacionados con la seguridad.</p>
<p>Lo peor que puede pasar es que hayan <strong>entrado en tu máquina</strong> y que ni te enteres, intentaré desmenuzar algunos consejos a seguir, para averiguar si nuestra máquina sigue siendo segura o no, al mismo tiempo que proporciono interesantes enlaces a documentación relacionada con este tema.</p>
<p><strong>Recomendaciones de Seguridad</strong>:</p>
<ol>
<li>Utilizar buenas contraseñas, para evitar los ataques a contraseña.</li>
<li>Utilizar encriptación en las comunicaciones: ssh, pgp, SSL, Ipsec ...</li>
<li>Habilitar únicamente los servicios necesarios.</li>
<li>Detectar puntos vulnerables del sistema: scanners.</li>
<li>Registro de sistema: logs.</li>
<li>Integridad del sistema: Tripwire, md5sum ...</li>
<li>Actualización del sistema debido a problemas de seguridad.</li>
<li>Utilización de Firewall.</li>
<li>Sistemas de detección de Instrusos (IDS): <a href="http://www.snort.org/"> snort</a>, <a href="http://www.lids.org/">LIDS</a>, ...</li>
<li>Utilización de un sistema de archivos encriptado.</li>
</ol>
<p>Aún siguiendo todas estas recomendaciones, no podremos estar seguros al 100% de que nuestro sistema no ha sido crackeado, y que cuando ejecutamos, por ejemplo, <strong>ps -aux</strong>, no estemos realmente ejecutando un troyano que recoge información <em>sensible</em> de nuestro sistema.<br />
Lo que tendremos que hacer es descubrir <strong>indicios</strong> de la presencia de los crackers en nuestra máquina:</p>
<p><strong>Verificar tamaños de archivos</strong>: <strong>ps</strong> suele medir 80 Kb, aunque podemos encontrar troyanos del comando <strong>ps</strong> de apenas 10Kb:</p>
<pre>$ type ps
ps is /bin/ps
$ l /bin/ps
-r-xr-xr-x    1 root     root        83096 Dec  5 23:11 /bin/ps
</pre>
<p>Una precaución adicional, es tener el almacenado el resultado del comando <strong>md5sum</strong> de los archivos más <strong>importantes/vulnerables</strong>, de forma que podemos comprobar si estos han sido fraudulentamente modificados, esto se debería de hacer, después de terminar la primera instalación del sistema.</p>
<pre>$ md5sum /bin/ps
3fb65605d59a7c89206926c1a600d220  /bin/ps
</pre>
<p>Precisamente esta es la función principal del programa <strong>Tripwire</strong> (<a href="http://www.tripwire.org/">http://www.tripwire.org/</a>),  asegurar la integridad de los archivos,  de una forma más flexible y potente que lo que tendríamos que montar  a través de scripts y md5sum.  Tripwire se distribuye con licencia <strong>GPL</strong> desde hace algun tiempo, siendo anteriormente comercial, este es el motivo por el que  encontrareís varios proyectos, que se autodenominan una alternativa al <strong>comercial</strong> tripwire. como aide  (<a href="http://www.cs.tut.fi/%7Erammer/aide.html"> http://www.cs.tut.fi/~rammer/aide.html</a>)</p>
<p>Otro truco habitual de los <strong>script kiddie</strong> es enlazar el comando <strong>history</strong> de la shell, para que apunte a <strong>/dev/null</strong>, de forma que no registre en el historico los comandos ejecutados:</p>
<pre>$ l /home/carlos/.bash_history
-rw-------    1 carlos   users        9434 Dec  8 19:44 .bash_history
</pre>
<p>Tendriamos que preocuparnos, si no topamos con algo como:</p>
<pre>$ l /home/carlos/.bash_history
lrwxrwxrwx    1 carlos   users           9 Dec  8 19:44 .bash_history -&#62;
/dev/null
</pre>
<p>Suelen usar otro tipo de <strong>shells</strong> mucho mas simplistas,  que no registren los comandos ejecutados,  de forma que se evitan el preocuparse de borrarlos. Por eso siempre es recomendable tener instalado únicamente lo que realmente se utiliza.</p>
<p>También suelen manipular los registros del sistema, quitando sus entradas, para que no quede constancia de sus actos en sitios/programas  como <strong>utmp</strong>, <strong>wtmp</strong>, <strong>lastlog</strong>,  <strong>/var/log/messages</strong> ...<br />
Más información en Anonymizing UNIX Systems : <a href="http://www.pimmel.com/articles/anonymous-unix.html"> http://www.pimmel.com/articles/anonymous-unix.html</a>.<br />
Para evitarlo:</p>
<ul>
<li>Mandar la parte más sensible del registro a un impresora, de forma que al cracker le seria imposible borrar estas entradas. Aunque si se da cuenta del truco, puede colapsar la impresora mandandole imprimir basura.</li>
<li>Utilizar otra máquina como registro, necesitará crackear esta otro máquina para eliminar todas sus huellas.</li>
<li>Mandar los logs por correo electrónico.</li>
<li>Cualquier otra posibilidad que se os ocurra. Existen varios sistemas de registro de log, mucho más potentes y seguros que el syslog típico de Linux, como por ejemplo <strong>Modular Syslog</strong> de la empresa Core (<a href="http://sourceforge.net/projects/msyslog/"> http://sourceforge.net/projects/msyslog/</a>), con licencia BSD.</li>
</ul>
<p>Podemos usar varios programas que detectan el borrado de estos log, algunos de los más populares son el Antizap y el Antizap2 (alguien sabe donde encontrarlos). (También podemos usar el chkrootkit,  tal y como veremos más adelante)</p>
<p>Es interesante examinar si aparecen <em>misteriosamente</em> cuentas de usuarios desconidas en el sistema, para lo cual examinaremos el fichero <strong>/etc/passwd</strong>:  Sólo debería aparecer el usuario <strong>root</strong>, con todos los privilegios.</p>
<pre>$ grep :x:0: /etc/passwd
root:x:0:0:root:/root:/bin/bash
</pre>
<p>Aqui tenemos la lista de todos los usuarios del sistema, si aparece alguno extraño, podemos empezar a sospechar:</p>
<pre>$ cat /etc/passwd &#124; awk -F':' '{print $1}'
</pre>
<p>Buscaremos en el sistema ficheros ocultos o raros, que puede ser usados para ocultar troyanos, directorios, comandos, etc...<br />
<em>Muchos piratas suelen crear directorios ocultos utilizando  nombres como '...' (punto-punto-punto), '..' (punto-punto),  '..^g' (punto-punto control+G), '\ ' (espacio en blanco),  '.\ ' (punto-espacio en blanco). En algunos casos un pirata ha utilizado nombres como '.x' o '.hacker'  o incluso '.mail' </em>.</p>
<p>Normalmente el <strong>script kiddie</strong>, habrá conseguido acceso como un usuario normal y explotando algún error/bug consigue privilegios de root, los comandos/programas <em>setuidados</em> son los principales objetivos de los crackers, por lo que no es mala idea tenerlos controlados.</p>
<pre>find / -perm +4000 -print
o
find / -user root -perm -4000 -print
</pre>
<p>Revisar la configuración de programas como <strong>cron</strong> y <strong>at</strong>, de forma que el posible pirata, no haya añadido ninguna entrada que le permita volver a entrar en el sistema posteriormente. Es interesante el averiguar realmente como ha entrado el cracker en el sistema, porque es la única forma de evitar que pueda volver a entrar de la misma forma.</p>
<p>Examinar el fichero /etc/inetd.conf en busca de cambios o entradas extrañas,  en especial la ejecuten un shell (por ejemplo: /bin/sh o /bin/csh)</p>
<p>Revisar cuidadosamente ficheros relacionados con el acceso o ejecución remota de comandos, tales como, /etc/hosts.equiv, /etc/hosts.lpd y  todos los .rhost del sistema.</p>
<p>Examinar detalladamente los ficheros de logs, analizado especialmente los logs de ftp, samba, servidor http, telnet, messages ...  Nos fijaremos en entradas desde lugares extraños,  verificaremos la fecha de los ficheros (es muy importante tener correctamente configurada la hora y fecha en todos los servidores).</p>
<p>Autor: Carlos Cortes Cortes<span style="font-family:Arial,Verdana,Helvetica,sans-serif;color:white;"><strong></strong><strong></strong></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Self-contained crontab Cheatsheet]]></title>
<link>http://nanotaboada.wordpress.com/?p=170</link>
<pubDate>Mon, 26 May 2008 00:55:10 +0000</pubDate>
<dc:creator>Nano Taboada</dc:creator>
<guid>http://nanotaboada.wordpress.com/?p=170</guid>
<description><![CDATA[This time I&#8217;m bringing you a self-documented cron table file (with an example), that is, a tid]]></description>
<content:encoded><![CDATA[<p>This time I'm bringing you a self-documented <a href="http://en.wikipedia.org/wiki/Cron" title="cron - Wikipedia, the free encyclopedia">cron</a> table file (with an example), that is, a tidy cheatsheet diagram embedded as comments that does just one thing, helps you remember the <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5" title="UNIX man pages   crontab(5)"><strong>crontab</strong></a> syntax:<br />
<code><strong><br />
#  * * * * *  command to be executed<br />
#  - - - - -<br />
#  &#124; &#124; &#124; &#124; &#124;<br />
#  &#124; &#124; &#124; &#124; +----- day of week (0 - 6) (Sunday=0)<br />
#  &#124; &#124; &#124; +------- month (1 - 12)<br />
#  &#124; &#124; +--------- day of month (1 - 31)<br />
#  &#124; +----------- hour (0 - 23)<br />
#  +------------- min (0 - 59)<br />
</strong><br />
# Alarm clock set to 6:30AM<br />
30 6 * * * /home/nano/alarm<br />
</code><br />
I hope you find it useful, thanks for reading and happy <a href="http://en.wikipedia.org/wiki/May_Revolution" title="May Revolution - Wikipedia, the free encyclopedia">May Revolution</a> Day to everyone!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rularea programata a aplicatiilor cu cron]]></title>
<link>http://unepetitemonde.wordpress.com/?p=68</link>
<pubDate>Fri, 25 Apr 2008 14:08:09 +0000</pubDate>
<dc:creator>unepetitemonde</dc:creator>
<guid>http://unepetitemonde.wordpress.com/?p=68</guid>
<description><![CDATA[Rularea programata a aplicatiilor cu cron
Cron este un organizator de procese care ne usureaza mult ]]></description>
<content:encoded><![CDATA[<p><strong>Rularea programata a aplicatiilor cu cron</strong><br />
Cron este un organizator de procese care ne usureaza mult munca. Ne ajuta sa rulam periodic programe la anumite ore din zi. Il putem utiliza in multe locuri, in general fiind folosit pentru intretinerea sistemului, backup sau actualizarea unor programe si baze de date.</p>
<p>crond este daemonul care ruleaza in fundal in sistemele UNIX si asemanatoare, si verifica in continuu lista de procese care trebuie rulate la o anumita data/ora. Principalul fisier de configurare este /etc/crontab in care sunt specificate programele care trebuie executate la o anumita ora, intr-o anumita data. De exemplu, daca deschideti /etc/crontab cu un editor de texte simplu veti gasi probabil mai multe linii printre care si cateva asemanatoare cu cele de mai jos:<br />
<a href="http://www.lamp.ro/linux/rularea-programata-a-aplicatiilor-cu-cron/" title="LAMP-Rularea programata a aplicatiilor cu cron">Click pentru a citi articolul complet-Rularea programata a aplicatiilor cu cron</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[To Change the default editor for crontab]]></title>
<link>http://newguy2linux.wordpress.com/?p=4</link>
<pubDate>Wed, 23 Apr 2008 11:01:25 +0000</pubDate>
<dc:creator>newguy2linux</dc:creator>
<guid>http://newguy2linux.wordpress.com/?p=4</guid>
<description><![CDATA[In Ubuntu the default editor for crontab is Nano.
we can change this by executing the following  co]]></description>
<content:encoded><![CDATA[<p>In Ubuntu the default editor for crontab is Nano.</p>
<p>we can change this by executing the following  command:</p>
<p>i.e. sudo update-alternatives –config editor</p>
<p>After executing  this command we can see like this</p>
<p>There are 4 alternatives which provide `editor'.</p>
<p>Selection    Alternative<br />
-----------------------------------------------<br />
1    /usr/bin/vim.tiny<br />
2    /bin/ed<br />
*+        3    /bin/nano<br />
4    /usr/bin/vim.basic</p>
<p>Press enter to keep the default[*], or type selection number: 1</p>
<p>Now we can select the editor by just typing the corresponding number.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cron and multiple recipients]]></title>
<link>http://anothersysadmin.wordpress.com/?p=61</link>
<pubDate>Mon, 31 Mar 2008 17:15:38 +0000</pubDate>
<dc:creator>Vide</dc:creator>
<guid>http://anothersysadmin.wordpress.com/?p=61</guid>
<description><![CDATA[If you are using a maintainance user executing scheduled cronjobs, maybe you&#8217;ve found yourself]]></description>
<content:encoded><![CDATA[<p>If you are using a maintainance user executing scheduled cronjobs, maybe you've found yourself needing to report the result of these jobs to different email addresses. Everyone knows for sure the MAILTO parameter, as explained in the crontab(5) manpages.</p>
<p>But maybe you don't know that MAILTO is interpreted sequencially, when it's found, so you can have different recipients in the same crontab, like in this example:</p>
<p><code><br />
MAILTO="user1@domain.tld"<br />
* * * * * echo "abc"</code><br />
MAILTO="user2@domain.tld"<br />
* * * * * echo "dfe"<br />
</code></p>
<p>so user1 will get mailed with "abc" and user2 with "dfe".<br />
It works in the standard "cron" program, so for example you can use this tip in Debian or FreeBSD (and in other Unices to, I guess)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cron Jobs and GoDaddy]]></title>
<link>http://geremiadoan.wordpress.com/?p=9</link>
<pubDate>Sun, 23 Mar 2008 16:20:24 +0000</pubDate>
<dc:creator>geremiadoan</dc:creator>
<guid>http://geremiadoan.wordpress.com/?p=9</guid>
<description><![CDATA[GoDaddy has a handy Cron Job utility.  It is in the Hosting Control Center under Content, then Cron ]]></description>
<content:encoded><![CDATA[<p>GoDaddy has a handy Cron Job utility.  It is in the Hosting Control Center under Content, then Cron Manager.  To run cron every hour on your Drupal site, insert the following command:<br />
curl -silent -compressed http://yoursite.com/cron.php<br />
Give it a name and set it to run every hour at whatever minute of the hour you want.  Seems to work fine.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Adding new entry into /etc/periodic/]]></title>
<link>http://rerepi.wordpress.com/?p=12</link>
<pubDate>Sat, 24 May 2008 08:58:16 +0000</pubDate>
<dc:creator>rerepi</dc:creator>
<guid>http://rerepi.wordpress.com/?p=12</guid>
<description><![CDATA[Did you know that you can easily add new time intervals into the system&#8217;s periodic feature?
Le]]></description>
<content:encoded><![CDATA[<p>Did you know that you can easily add new time intervals into the system's periodic feature?</p>
<p>Let's add /etc/periodic/hourly as the example:</p>
<p><!--more--></p>
<pre>#&#62; mkdir /etc/periodic/hourly
#&#62; # creating the crontab entry to run scripts at 25 minutes every hour
#&#62; echo "25	*	*	*	*	root	periodic hourly" &#62;&#62; /etc/crontab</pre>
<p>into /etc/periodic.conf:</p>
<pre>hourly_output="root"				# user or /file
weekly_show_success="NO"			# scripts returning 0
weekly_show_info="YES"				# scripts returning 1
weekly_show_badconfig="NO"			# scripts returning 2</pre>
<p>That's all. We are done! Now you can place executable scripts into /etc/periodic/hourly and they will run every hour under root account.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Planificador de tareas]]></title>
<link>http://guadalinex.wordpress.com/?p=58</link>
<pubDate>Fri, 16 May 2008 07:48:10 +0000</pubDate>
<dc:creator>enramos</dc:creator>
<guid>http://guadalinex.wordpress.com/?p=58</guid>
<description><![CDATA[En Linux, la aplicación que se encarga de planificar tareas es cron.
Algunas referencias que podemo]]></description>
<content:encoded><![CDATA[<p>En Linux, la aplicación que se encarga de planificar tareas es cron.</p>
<p>Algunas referencias que podemos seguir para aprender a manejarlo son:</p>
<ul>
<li>http://www.linuxtotal.com.mx/index.php?cont=info_admon_006</li>
<li>http://www.gentoo.org/doc/es/cron-guide.xml</li>
<li>http://www.estrellateyarde.es/equiv/cron</li>
<li>http://es.wikipedia.org/wiki/Cron_(unix)</li>
</ul>
<p>No obstantes, si no nos gusta la consola, podemos utilizar alguno de los entorno gráficos que tenemos disponibles, entre ellos, los más actualizados son:</p>
<ul>
<li>http://gnome-schedule.sourceforge.net/</li>
<li>http://docs.kde.org/kde3/en/kdeadmin/kcron/index.html</li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[HOWTO: Automatically Backup Your Linux system with rsync]]></title>
<link>http://ajclarkson.wordpress.com/?p=48</link>
<pubDate>Thu, 15 May 2008 13:16:08 +0000</pubDate>
<dc:creator>ajclarkson</dc:creator>
<guid>http://ajclarkson.wordpress.com/?p=48</guid>
<description><![CDATA[So,
One of the things I was wondering about, and had never really done in linux, was backing up my f]]></description>
<content:encoded><![CDATA[<p>So,</p>
<p>One of the things I was wondering about, and had never really done in linux, was backing up my files. Working as a Programmer and Web Developer, I have issues arising all of the time with bits of code that have gone missing as a result of accidents. I decided I needed a better backup system, and what better way than to make one which simply backs everything up without your input!</p>
<p>I decided that I would back my sourcecode files "/home/ajc/src" and my documents "/home/ajc/doc" every week. That way a loss could not be too catastrophic.</p>
<p>The tool which I chose to use was <strong>rsync</strong>. Many modern distributions come with this built in (I use ubuntu) and if they don't this will certainly be in the repositories.</p>
<p>First things first. Set up the destination folder for your files: </p>
<p><code>#mkdir /media/vince/data_Backup</code> in my case.</p>
<p>Once that is done you are ready to learn rsync.</p>
<p>The command which I use for my backups is as follows (it has a few extra options which I will explain)</p>
<p><code>#sudo rsync -av --progress --delete --log-file=/home/ajc/doc/$(date +%Y%m%d)_rsync.log /home/ajc/src /media/vince/data_Backup</code></p>
<p>As you can see this line of code deals with my source folder. The options are: "-a" for archive "v" means verbose so you will see detailed output "--progress" gives a progress update in terminal "--delete" will delete any items in the destination which you have removed from the source "--log-file" specifies the location for a log file to be kept. Other than that for those of you unfamiliar with bash script "$(date +%Y%m%d)" is used to inject the current date. So the filename for today would be 20080515_rsync.log</p>
<p>Go ahead and change the source file and destination file (last two sections of the command) and run it on your system. You will see that for a reasonable amount of data this is a quick process!</p>
<p>Now you know the command thats all well and good, it means that you can backup things when you want. However, we all know that this is easy to forget! So how about scheduling this task through a cron job?</p>
<p>You must begin by converting this command into a bash script. This is easier than it may sound. Just create the following (with your paths) in a text editor and save it to your home directory.</p>
<p><code><br />
#! /bin/bash<br />
sudo rsync -av --progress --delete --log-file=/home/ajc/doc/$(date +%Y%m%d)_rsync.log /home/ajc/src /media/vince/data_Backup<br />
</code></p>
<p>Next we must make the file executable</p>
<p><code>#sudo chmod +x /home/ajc/rsync-demo.sh</code></p>
<p>And then you have a file which you can click to run. However, we want automation, so here comes the cron bit</p>
<p>move the file to the root directory. (So that cron doesn't ask you for a password when it runs)</p>
<p><code>#sudo mv /home/ajc/rsync-demo.sh /root/rsync-demo.sh</code></p>
<p>Then we want to open the crontab so we can schedule a job</p>
<p><code> #sudo crontab -e</code></p>
<p>here you should have several headings: m (minute of the hour) h (hour) dom (date of month) mon (month) dow (day of week) command. Now as you can see from this we have quite a wide range of choice as to when this script will be run. I chose 10pm every friday as the one I wanted. So the sequence was: </p>
<p><code> 0 22 * * 5 /root/rsync-demo.sh </code></p>
<p>So 0 minutes, 22 hours, any date of the month, any month of the year, day 5 (friday) and the path to my script.</p>
<p>Simple. Now crontab will have opened in your default text editor so issue the command to save and exit (mines nano so Ctl + O then Ctl + X) and you will see a line confirming that the job has been added.</p>
<p> Done. Next time I will show you how to automate a backup to dvd! </p>
]]></content:encoded>
</item>

</channel>
</rss>
