lunes, 22 de enero de 2007

Linux: Tarea programada (CRONTAB)

1. Crear un archivo con extensión .sh:
# vi [nombre_archivo].sh

2. Editar el contenido del archivo:
- Para realizar backup de correos:
tar cvfpR [ruta_destino/nombre_archivo]$(date +%Y%m%d).tar [ruta_origen/carpeta]
- Para enviar correos:
mail [usuario_correo] –s “[asunto_correo]” < [ruta/archivo_del_mensaje*]
* [archivo_del_mensaje] es el que va a contener el cuerpo del correo (crear un archivo nuevo)

3. Otorgar permisos al archivo .sh :
# chmod +x [nombre_archivo].sh

4. Ejecutar el archivo .sh para comprobar su funcionamiento:
# ./[nombre_archivo].sh

5. Agregar un nuevo directorio (el que contiene el archivo .sh )a la variable PATH:
# export PATH=$PATH:/[directorio_a_agregar]

6. Comprobar el nuevo valor de la variable:
# set
7. Editar el archivo ‘/etc/crontab’ para agregar una nueva tarea:
# vi /etc/crontab

[minuto] [hora] [dia_mes] [mes] [dia_semana] root [ruta/tarea (archivo .sh)]

---
JCFx

15 comentarios:

erasmo dijo...

excelente ayuda, me gusta mucho cuando consigo exlicaciones tan detallas de un tema. for dummy. mochisimas gracias

Anónimo dijo...

Rescue Our Bereavement of consciousness Prices at www.Pharmashack.com, The Unforgettable [b][url=http://www.pharmashack.com]Online Chemist's [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Espy Massive Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Repress a Endless Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] In compensation Your Nutriment ! We Huckster Take-over splotch [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

Anónimo dijo...

I read this forum since 2 weeks and now i have decided to register to share with you my ideas. [url=http://inglourious-seo.com]:)[/url]

Anónimo dijo...

You could easily be making money online in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat download[/URL], Don’t feel silly if you haven’t heard of it before. Blackhat marketing uses little-known or little-understood methods to produce an income online.

Anónimo dijo...

[url=http://www.onlinecasinos.gd]Online casinos[/url], also known as accepted casinos or Internet casinos, are online versions of venerable ("buddy and mortar") casinos. Online casinos set excepting gamblers to extemporize and wager on casino games with the replace the Internet.
Online casinos chiefly ask for odds and payback percentages that are comparable to land-based casinos. Some online casinos denominate higher payback percentages with a position affect gismo games, and some bruit about payout intimate audits on their websites. Assuming that the online casino is using an fittingly programmed unsystematic sum up generator, mothball games like blackjack clothed an established discourage edge. The payout slice after these games are established at closer the rules of the game.
Uncounted online casinos sublease or seize their software from companies like Microgaming, Realtime Gaming, Playtech, Ecumenical Prank Technology and CryptoLogic Inc.

Anónimo dijo...

http://site.ru - [url=http://site.ru]site[/url] site
site

Anónimo dijo...

top [url=http://www.001casino.com/]free casino bonus[/url] coincide the latest [url=http://www.casinolasvegass.com/]casino games[/url] autonomous no store reward at the chief [url=http://www.baywatchcasino.com/]charitable casino games
[/url].

Anónimo dijo...

harlequin intrigue ebook http://audiobookscollection.co.uk/We-Are-All-Self-Employed-How-to-Take-Control-of-Your-Career/p148670/ johnny bench ebook torrent [url=http://audiobookscollection.co.uk/de/The-Underland-Chronicles-Books-1-5/p12476/]cussler ebook torrents[/url] ebook 8086

Anónimo dijo...

tros of samothrace ebook http://audiobooksworld.co.uk/authors/?letter=Q&page=6 ebook leader [url=http://audiobooksworld.co.uk/it/Endurance-Exercise-and-Adipose-Tissue/p169398/]freen online erotic ebook[/url] ebook evidence-based orthopaedics
[url=http://audiobooksworld.co.uk/de/Killer-angel-A-biography-of-Planned-Parenthood-s-founder-Margaret-Sanger/p227243/][img]http://audiobooksworld.co.uk/image/4.gif[/img][/url]

Anónimo dijo...

garmin map software australia http://buyoemsoftware.co.uk/category-100-108/Office-Tools?page=39 windows mobile 6.1 windowss xp software [url=http://buyoemsoftware.co.uk/product-36815/Emurasoft-EmEditor-Professional-11-0-Portable-MULTILINGUAL]woodworkers estimating software[/url] synchronizing software time
[url=http://buyoemsoftware.co.uk/product-37146/The-Palette-Melody-Composing-Tool-4-4]The Palette Melody Composing Tool 4.4 - Software Store[/url] tarantula software
[url=http://buyoemsoftware.co.uk/product-31618/MovCaptioner-3-6-MAC][img]http://buyoem.co.uk/image/6.gif[/img][/url]

Anónimo dijo...

act mortgage software training http://buyoemsoftware.co.uk/it/category-200-212/Multimediale-e-Divertimenti?page=3 blumen software trio [url=http://buyoemsoftware.co.uk/de/category-200-203/Grafiken-and-Publishing]billing care health home software[/url] best movie ripping software
[url=http://buyoemsoftware.co.uk/product-35530/Chronos-iClipboard-3-0-MacOSX]Chronos iClipboard 3.0 MacOSX - Cheap Legal OEM Software, Software Sale, Download OEM[/url] wifi power analyzer software
[url=http://buyoemsoftware.co.uk/es/manufacturer-15/VMware][img]http://buyoem.co.uk/image/2.gif[/img][/url]

Anónimo dijo...

computer programming software for education http://buysoftwareonline.co.uk/it/product-36428/Benthic-Software-Golden-6-6-0 open suorce software education [url=http://buysoftwareonline.co.uk/de/product-31546/Invoice-3-0-MAC]mcgraw hill ged software[/url] gps navigation software for mio 168
[url=http://buysoftwareonline.co.uk/product-36561/ProjectCodeMeter-1-0]ProjectCodeMeter 1.0 - Download OEM, Software Sale, OEM Software[/url] matrix warehouse software
[url=http://buysoftwareonline.co.uk/fr/category-6/Logiciel-de-serveur][img]http://buyoem.co.uk/image/2.gif[/img][/url]

Anónimo dijo...

wifi tracking software http://buysoftwareonline.co.uk/category-200-212/Multimedia-and-Entertainment?page=5 gpss general purpose system software [url=http://buysoftwareonline.co.uk/product-36997/ACD-Canvas-12-Wine]palm polit software[/url] accounting software real estate mac canadian
[url=http://buysoftwareonline.co.uk/product-36356/Etasoft-EDI-Validator-2-1]Etasoft EDI Validator 2.1 - Download OEM, Software Sale, OEM Software[/url] gas pos software
[url=http://buysoftwareonline.co.uk/fr/product-37137/Sothink-DHTML-Menu-8-2][img]http://buyoem.co.uk/image/2.gif[/img][/url]

Anónimo dijo...

best design page software web http://buysoftwareonline.co.uk/fr/product-37206/MemTurbo-4-1 password spy software [url=http://buysoftwareonline.co.uk/fr/product-14171/iCab-X-4-Mac]best dvd ripping software programs[/url] accounting software for animal shelters
[url=http://buysoftwareonline.co.uk/product-14239/Synchronize-Pro-X-5-0-Mac]Synchronize Pro X 5.0 [Mac] - Download OEM, Software Sale, OEM Software[/url] t3 telecom software
[url=http://buysoftwareonline.co.uk/product-32616/RinjaniSoft-Slicksync-QuickBooks-Synchronizer-Pro-1-1][img]http://buyoem.co.uk/image/3.gif[/img][/url]

Anónimo dijo...

is tony romo dating jessica simpson [url=http://freeinternetdating.info/friendship/friendship-valentine-ecard-dalmatian]friendship valentine ecard dalmatian[/url] mark ballas and sabrina bryan dating
millionair single dating services http://freeinternetdating.info/romantic/romantic-calenders-for-couples 8 rules to dating my daughter
100 free singles dating [url=http://freeinternetdating.info/relationships/troubled-relationships-help-and-advice]acme dating service in wv[/url] radioactive carbon dating useful