Archive for the 'Networking' Category

Crontab, si Tepat waktu

okay, langsung ajah..
di sistem operasi Unix dikenal sebuah fasilitas penjadwalan otomatis yang dinamakan cron/crontab.

secara umum, cron disimpan pada sebuah file yang letak dan namanya berbeda pada setiap distronya.Di Linux saya biasa memakai Fedora, dan BSD dengan OpenBSD. Nama, dan letak file konfigurasi di kedua distro tersebut berbeda. Di Fedora, ada di /etc/crontab, sedangkan di OpenBSD (dan distribusi BSD umumnya) terletak di /var/cron/tabs/root.

fungsinya adalah sama saja, yaitu untuk mencatat perintah (bisa berupa command line langsung maupun command yang sudah tersusun dalam sebuah file bash/shell/perl script) serta waktu (timing) kapan perintah tersebut akan dieksekusi.

Penulisan file cron ini pun sedikit berbeda pada setiap distro, namun secara garis besarnya sama.
bentuk umunya adalah sebagai berikut:

* * * * * * *

penjelasan :

di atas adalah bentuk umum untuk sintaks crontab. Terlihat ada 7 kolom (blok)

  • blok pertama adalah menit, yaitu menunjukkan menit pada jam yg dipilih — nilainya 0-59.
  • blok kedua adalah jam, yaitu menunjukkan jam pada hari/tanggal yang telah ditentukan. — nilainya 0-23.
  • blok ketiga adalah tanggal, yaitu menunjukkan tanggal pada bulan yang telah ditentukan. — nilainya 1-31.
  • blok keempat adalah bulan, yaitu menunjukkan bilangan bulan. — nilainya 1-12
  • blok kelima adalah hari dalam minggu, yaitu menunjukkan urutan hari dalam seminggu. — nilainya 1-7
  • blok keenam adalah user yang diberi hak untuk melakukan command. (blok ini tidak selalu diperlukan)
  • blok ketujuh adalah command atau letak file perintah.

contoh #1

30 05 * * * root rm /var/log/httpd/*

penjelasan:
jadi, setiap hari, pukul 05:30 pagi, perintah “rm /var/log/httpd/*” akan dieksekusi, yang berarti akan menghapus semua file dalam folder /var/log/httpd/.

contoh#2

10 05 01 * * root /bin/sh /etc/script.sh

penjelasan:
pada pukul 05:01 setiap tanggal 1, setiap bulannya, akan dieksekusi kumpulan perintah pada file “/etc/script.sh” (yang berupa file shell/bash script).
Sekian dulu, kalau ada waktu dan ilmu baru, insyaAllah saya tulis lagi..
-mohon koreksi-

regards,
dEekZ_

What is a Protocol ?

In a beautiful summer you have a picnic at a nice garden with some friends.
Immediatelly you’re meeting a stranger from another country which of course having a different language with you.

He asking you to get know each other and introduce him self to you.. Of course you don’t understand what his purpose, why ? of course because you are using different language with him.
You just taking it easy and introduce your self too. After all, you start to tell him about your beautiful country.. once again.. with your own language which unknown by your new friend.
You told him many things.. and immediatelly he bust you and take you to the police because he thought that you’re a terorist according to your conversations.. once again.. why ? sure.. because he dont understand your language.

Well, now lets finish the story and start the lessons… :D how important a Protocol are ? of course the answer are: very important.
the protocol allow some device (in this case computers) to communicate each other.
We can say that protocol is a language for human being.. by the protocol devices can share information, share the source or even some connections to internet.

there are many protocol invented. As long as my experience each vendor has assign their own protocol to connects their devices.
as example Novell with NETBios, Aple MacIntosh with ApleTalk also Unix with IPX.

OK, enough for this time.. see you at next tutorials..
bye!

-Mas Deekz_-

« Previous Page