Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision Next revisionBoth sides next revision | ||
| es:docs:guide-user:base-system:cron [2023/12/26 16:35] – created brodrigueznu | es:docs:guide-user:base-system:cron [2023/12/26 18:02] – Minor changes brodrigueznu | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ===== Objetivos ===== | ===== Objetivos ===== | ||
| - | * Run programs or scripts | + | * Ejecutar programas o scripts |
| - | * Automate scheduled task management. | + | * Automatizar la gestión de tareas programadas. |
| - | ===== Web interface instructions | + | ===== Instrucciones de la interfaz web ===== |
| - | Set up cron jobs using web interface. | + | Configurar tareas |
| - | - Navigate to **LuCI -> System -> Scheduled Tasks**. | + | - Navegue a **LuCI -> System -> Scheduled Tasks**. |
| - | - Edit the configuration and click the **Save** | + | - Edite la configuración y haga clic en el botón |
| - | ===== Command-line instructions | + | ===== Instrucciones de línea de comando |
| - | Set up cron jobs using command-line interface. | + | Configurar tareas |
| <code bash> | <code bash> | ||
| - | # Edit configuration | + | # Editar configuración |
| crontab -e | crontab -e | ||
| - | # Show configuration | + | # Mostrar configuración |
| crontab -l | crontab -l | ||
| - | # Apply changes | + | # Aplicar cambios |
| service cron restart | service cron restart | ||
| </ | </ | ||
| - | This will edit the configuraion | + | Esto editará el archivo de configuración |
| - | :!: There should be a EOL character on the last line of the crontab | + | :!: Debe haber un carácter |
| - | Just leave an empty line at the end to be sure. | + | Simplemente deje una línea vacía al final para estar seguro. |
| - | ===== Task specification | + | ===== Especificación de tarea ===== |
| - | Each line is a separate task written in the specification: | + | Cada línea es una tarea separada escrita en la especificación: |
| < | < | ||
| - | * * * * * command to execute | + | * * * * * comando a ejecutar |
| - - - - - | - - - - - | ||
| | | | | | | | | | | | | ||
| - | | | | | ----- Day of week (0 - 6) (Sunday | + | | | | | ----- Día de la semana |
| - | | | | ------- | + | | | | ------- |
| - | | | --------- | + | | | --------- |
| - | | ----------- | + | | ----------- |
| - | ------------- | + | ------------- |
| </ | </ | ||
| - | Examples of time specification: | + | Ejemplos de especificación de tiempo: |
| - | ^ min\\ 0-59 ^ | + | ^ min\\ 0-59 ^ |
| - | | */5 | * | * | * | * | Every 5 minutes | + | | */5 | * | * | * | * | Cada 5 minutos |
| - | | 12 | */3 | * | * | * | Every 3 hours at 12 minutes | + | | 12 | */3 | * | * | * | Cada 3 horas a los 12 minutos |
| - | | 57 | 11 | 15 | 1,6,12 | * | At 11:57 Hrs on 15th of Jan, June & Dec | | + | | 57 | 11 | 15 | 1,6,12 | * | A las 11:57 Hrs el día 15 de Ene, Jun & Dic | |
| - | | 25 | 6 | * | * | 1-5 | At 6:25 AM every weekday | + | | 25 | 6 | * | * | 1-5 | A las 6:25 AM cada día laboral |
| - | | 0 | 0 | 4, | + | | 0 | 0 | 4, |
| - | | 5,10 | 9,14 | 10 | * | 0,4 | At 9:05AM, 9:10AM, 2: | + | | 5,10 | 9,14 | 10 | * | 0,4 | A las 9:05AM, 9:10AM, 2: |
| - | :!: 0 (zero) is treated as Sunday. | + | :!: 0 (cero) se trata como domingo. |
| - | If you set the day of the week to 7, BusyBox | + | Si configura el día de la semana en 7, BusyBox |
| - | **Table of shortcuts:** | + | **Tabla de atajos:** |
| - | ^ Shortcut | + | ^ Atajo ^ Equivalencia |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | : | + | : |
| - | ===== Troubleshooting | + | ===== Solución de problemas |
| - | You can read log messages with: | + | Puede leer mensajes de registro con: |
| <code bash> | <code bash> | ||
| Line 85: | Line 85: | ||
| </ | </ | ||
| - | Not all messages are logged, to increase logging change | + | No todos los mensajes se registran, para aumentar el registro cambie la opción |
| ===== Extras ===== | ===== Extras ===== | ||
| - | ==== References | + | ==== Referencias |
| * [[man> | * [[man> | ||
| * [[https:// | * [[https:// | ||
| * [[http:// | * [[http:// | ||
| - | ==== Periodic reboot | + | ==== Reinicio periódico |
| - | A simple workaround for some hard-to-solve problems | + | Una solución sencilla para algunos problemas difíciles de resolver |
| - | However, this is not as simple as it seems, because the router | + | Sin embargo, esto no es tan sencillo como parece, ya que el router |
| - | This could lead to a never-ending loop of reboots. | + | Esto podría provocar un ciclo interminable de reinicios. |
| - | In the boot process the clock is initially set by '' | + | En el proceso de arranque, el reloj se configura inicialmente mediante "sysfixtime" con la marca de tiempo más reciente de cualquier archivo que se encuentre en /etc. |
| - | The most recent file is possibly a status file or config file, modified maybe 30 seconds before the reboot initiated by cron. | + | El archivo más reciente es posiblemente un archivo de estado o un archivo de configuración, modificado quizás |
| - | So, in the boot process the clock gets set backwards a few seconds to that file's timestamp. | + | Entonces, en el proceso de arranque, el reloj se retrasa unos segundos hasta la marca de tiempo de ese archivo. |
| - | Then cron starts and notices a few seconds later that the required boot moment has again arrived and reboots again... | + | Luego, |
| - | At the end of the boot process | + | Al final del proceso de arranque, se inicia |
| - | One solution for cron is to use a delay and touch a file in ''/ | + | Una solución para cron es utilizar un retraso y tocar un archivo en ''/ |
| <code bash> | <code bash> | ||
| - | # Reboot at 4:30am every day | + | # Reiniciar a las 4:30 a. m. todos los días |
| - | # Note: To avoid infinite reboot loop, wait 70 seconds | + | # Nota: Para evitar un bucle de reinicio infinito, espere |
| - | # and touch a file in /etc so clock will be set | + | # y toque un archivo en /etc para configurar el reloj |
| - | # properly to 4:31 on reboot before | + | # correctamente a las 4:31 a.m. al reiniciar antes de que comience |
| 30 4 * * * sleep 70 && touch /etc/banner && reboot | 30 4 * * * sleep 70 && touch /etc/banner && reboot | ||
| </ | </ | ||
| - | :!: On many platforms | + | :!: En muchas plataformas |
| - | There is usually | + | Por lo general, |
| - | '' | + | '' |
| - | ==== Periodic network restart | + | ==== Reinicio periódico de la red ==== |
| - | A simple solution for restart all your network | + | Una solución sencilla para reiniciar toda su red (lan, wan y wifi) cada 10 minutos es esta: |
| <code bash> | <code bash> | ||
| Line 126: | Line 126: | ||
| </ | </ | ||
| - | ==== Alarm clock ==== | + | ==== Despertador |
| - | If you have [[wp> | + | Si tiene [[wp> |
| - | When DST starts in central Europe, clocks advance from 02:00 CET to 03:00 CEST on last Sunday in March. | + | Cuando comienza el horario de verano en Europa Central, los relojes avanzan de las 02:00 CET a las 03:00 CEST del último domingo de marzo. |
| - | Six day before that, you could make your WoL wake you 10 minutes earlier. | + | Seis días antes, podría hacer que su WoL le despierte |
| - | Later won't work, you'll be late. | + | Más tarde no funcionará, llegará tarde. |
| - | When DST ends in central Europe, clocks retreat from 03:00 CEST to 02:00 CET on last Sunday in October. | + | Cuando finaliza el horario de verano en Europa Central, los relojes retroceden de las 03:00 CEST a las 02:00 CET del último domingo de octubre. |
| <code bash> | <code bash> | ||
| - | # min hour day month dayofweek command | + | # min hora día mes día-de-la-semana comando |
| 59 05 * * 1 / | 59 05 * * 1 / | ||
| - | # crontab | + | # crontab |
| </ | </ | ||
| - | ==== Keep number of configs | + | ==== Mantener el número de configuraciones/instantáneas de configuración |
| - | To keep a number | + | Para mantener un número |
| <code bash> | <code bash> | ||
| - | #Make a new backup/configurations snapshot at nighttime 00:01 am, keep last N=100 snapshots | + | #Hacer una nueva instantánea de copia de seguridad/configuraciones durante la noche a la 12:01 a. m., conserve las últimas |
| - | #01 00 * * * sysupgrade -b "/ | + | #01 00 * * * sysupgrade -b "/ |
| 01 00 * * * find "/ | 01 00 * * * find "/ | ||
| </ | </ | ||