Red Hat ENTERPRISE LINUX WS 2.1 - Guia de Instalação Página 226

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
Vista de página 225
226 Important Linux features
DONE
INDEX
INDEX
13.4.3 cron - crontab
Any Linux command or program can be executed automatically on a regular basis.
check if crond is running: ps -efw| grep crond
if crond is not running: service crond start
create a crontab file using the following syntax:
min hour daymo month daywk command
min: minute (0-59)
hour: hour (0-23)
daymo: day of the month (1-31)
month: month of the year (1-12)
daywk: day of the week (0-6 with 0=Sunday)
command: the command or program to be executed
Suppose you want to:
backup your data at 4.30 am on Tuesday to Friday
delete all core files at 2 am on Sunday
Note that the second task needs root permissions.
a) type cd to go to your home directory
b) type su to become root
c) edit the file fila and enter the following lines:
30 04 * * 2-5 tar cv /u/data/<user>/nmr
00 02 * * 0 find / -name core -exec rm {} \;
d) type crontab fila
You can skip step b) if all tasks in your crontab file can be done as normal user.
Type man crontab for more information.
Vista de página 225
1 2 ... 221 222 223 224 225 226 227 228 229 230 231 ... 271 272

Comentários a estes Manuais

Sem comentários