Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa |
es:howtos:general_admin:task_scheduling [2019/02/10 09:29 (UTC)] – [Programación interna de at] pedro.herrero | es:howtos:general_admin:task_scheduling [2019/02/10 09:45 (UTC)] (actual) – Finished. Comments and corrections welcome pedro.herrero |
---|
<!-- Reviewed 2013-10-16 mfillpot --> | <!-- Reviewed 2013-10-16 mfillpot --> |
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> |
<note>Translation in progress (pedro.herrero)</note> | |
====== Programación de tareas en Linux ====== | ====== Programación de tareas en Linux ====== |
=====Panorama general===== | =====Panorama general===== |
</code> | </code> |
| |
=====Using cron===== | =====Uso de cron===== |
| |
**//cron//** is a daemon that runs tasks in the background at specific times. For example, if you want to automate downloads of patches on a specific day (Monday), date (2 July), or time (1300), **//cron//** will allow you to set this up in a variety of ways. The flexibility inherent in **//cron//** can allow administrators and power users to automate repetitive tasks, such as creating backups and system maintenance. | **//cron//** es un demonio que ejecuta tareas en segundo plano en momentos específicos. Por ejemplo, si desea automatizar las descargas de parches en un día específico (lunes), fecha (2 de julio) u hora (1300), **//cron//** le permitirá configurar esto de varias maneras. La flexibilidad inherente en **//cron//** puede permitir a los administradores y usuarios avanzados automatizar tareas repetitivas, como la creación de copias de seguridad y el mantenimiento del sistema. |
| |
**//cron//** is usually configured using a //crontab// file. The following command will open your user account //crontab// file: | **//cron//** se configura normalmente utilizando un archivo //crontab//. El siguiente comando abrirá el archivo //crontab// de su cuenta de usuario: |
| |
<code> | <code> |
</code> | </code> |
| |
To edit the system-level //crontab//, first log into the root account: | Para editar el nivel de sistema //crontab//, primero inicie sesión en la cuenta root: |
| |
<code> | <code> |
</code> | </code> |
| |
If your system has **//sudo//** installed, type in: | Si su sistema tiene **//sudo//** instalado, ingrese: |
| |
<code> | <code> |
</code> | </code> |
| |
The //crontab// file syntax is: | La sintaxis del archivo //crontab// es: |
| |
<code> | <code> |
# * * * * * command to execute | # * * * * * Comando a ejecutar |
# │ │ │ │ │ | # │ │ │ │ │ |
# │ │ │ │ │ | # │ │ │ │ │ |
# │ │ │ │ └───── day of week (0 - 6) (Sun(0) /Mon (1)/Tue (2)/Wed (3)/Thu (4)/Fri (5)/Sat (6)) | # │ │ │ │ └───── día de la semana (0 - 6) (Dom(0) /Lun (1)/Mar (2)/Mie (3)/Jue (4)/Vie (5)/Sab (6)) |
# │ │ │ └────────── month (1 - 12) | # │ │ │ └────────── mes (1 - 12) |
# │ │ └─────────────── day of month (1 - 31) | # │ │ └─────────────── día del mes (1 - 31) |
# │ └──────────────────── hour (0 - 23) | # │ └──────────────────── hora (0 - 23) |
# └───────────────────────── min (0 - 59) | # └───────────────────────── minuto (0 - 59) |
</code> | </code> |
| |
Using an asterisk in any placeholder location, will match any value. For example, the following will run //example_script.sh// at noon (1200) everyday during the first three months of the year: | Usando un asterisco en cualquier ubicación de marcador de posición, coincidirá con cualquier valor. Por ejemplo, lo siguiente se ejecutará //example_script.sh// al mediodía (1200) todos los días durante los primeros tres meses del año: |
| |
<code> | <code> |
</code> | </code> |
| |
=====Using anacron===== | =====Uso de anacron===== |
<note> | <note> |
**//anacron//** is not installed in Slackware by default.((See [[http://slackbuilds.org/repository/13.37/system/anacron/|Slackbuilds.org]] for more information on **//anacron//** on Slackware)) | **//anacron//** no se inastala en Slackware de manera predeterminada.((Ver [[http://slackbuilds.org/repository/13.37/system/anacron/|Slackbuilds.org]] para más información de **//anacron//** en Slackware)) |
</note> | </note> |
| |
**//anacron//** is unique from **//cron//** in the respect that it does not expect the operating system to be running continuously like a 24x7 server. If the time of execution passes while the system is turned off, **//anacron//** executes the command automatically when the machine is turned back on. The reverse is **not** true for **//cron//** - if the computer is turned off during the time of scheduled execution, **//cron//** will not execute the job. Another key difference between **//anacron//** and **//cron//** is the minimum chronological "granularity" - **//anacron//** can only execute jobs by //day//, versus the ability of **//cron//** to execute by the //minute//. Finally, **//anacron//** can __only__ be used by root, while **//cron//** can be used by root and normal users. | **//anacron//** es único respecto a **//cron//** en el sentido de que no espera que el sistema operativo se ejecute continuamente como un servidor 24x7. Si el tiempo de ejecución pasa mientras el sistema está apagado, **//anacron//** ejecuta el comando automáticamente cuando la máquina se enciende de nuevo. Lo contrario **no** es cierto para **//cron//**: si el equipo está apagado a la hora de la ejecución programada, **//cron//** no ejecutará el trabajo. Otra diferencia clave entre **//anacron//** y **//cron//** es la "granularidad" cronológica mínima - **//anacron//** sólo puede ejecutar trabajos cada //día//, frente a la capacidad de **//cron//** de ejecutarlos al //minuto///. Finalmente, **//anacron//** puede __sólo__ ser usado por root, mientras que **//cron//** puede ser usado por root y usuarios normales. |
| |
====== Sources ====== | ====== Fuentes ====== |
<!-- If you are copying information from another source, then specify that source --> | <!-- If you are copying information from another source, then specify that source --> |
<!-- * Original source: [[http://some.website.org/some/page.html]] --> | <!-- * Original source: [[http://some.website.org/some/page.html]] --> |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> |
* Originally written by [[wiki:user:vharishankar | vharishankar]] | * Originalmente escrito por [[wiki:user:vharishankar | vharishankar]] |
* Contrbutions by [[wiki:user:mfillpot |mfillpot]], [[wiki:user:tdrssb |tdrssb]] | * Contribuciones de [[wiki:user:mfillpot |mfillpot]], [[wiki:user:tdrssb |tdrssb]] |
* Example crontab example modified from [[en.wikipedia.org/wiki/cron]] | * Ejemplo crontab modificado de [[en.wikipedia.org/wiki/cron]] |
| * Traducido por --- //[[wiki:user:pedro.herrero|Pedro Herrero García]] 2019/02/10 09:43 (UTC)// |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> |
<!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> | <!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> |
{{tag>howtos task_scheduling needs_attention author_vharishankar author_mfillpot}} | {{tag>howtos task_scheduling needs_attention author_vharishankar author_mfillpot}} |
| |