Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Aprendiz CSS

[Resolvido] CronTab opções

Recommended Posts

opa!

 

a busca do forum é fantastica!

 

pesquisei por crontab e cheguei nisso: http://forum.imasters.com.br/index.php...&hl=crontab

 

gostaria de saber qual o significado das opções

 

o script abaixo é no meu caso, ok

 

0 9 * * 6 php /diretorio/pastaWEB/arquivo.php

lendo o que o topico acima me disse cheguei as conclusões abixo

 

o segundo paramento é o horario [ pergunta como faço para ser 22 horas ]

 

o quinto paramento seja o dia da semana, correto? [ pergunta, como ser de segunda a sabado ]

 

o sexto é o comando que vou executar

 

o setimo o arquivo

 

gostaria de saber o que os outros paramentros fazem?

 

PS: minha distribuição é opensuse

 

não testei ainda, por isso não sei se funciona!

 

espero que me ajudem

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

man 5 crontab

 

The format of a cron command is very much the V7 standard, with a number of upward-compatible extensions. Each line has five time and date fields, followed by a command, followed by a newline character ("\n"). The system crontab (/etc/crontab) uses the same format, except that the username for the command is specified after the time and date fields and before the command. The fields may be separated by spaces or tabs.

 

The time and date fields are:

 

field allowed values

----- --------------

minute 0-59

hour 0-23

day of month 1-31

month 1-12 (or names, see below)

day of week 0-7 (0 or 7 is Sun, or use names)

 

Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, 8-11 for an hours entry specifies execution at hours 8, 9, 10 and 11.

Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: 1,2,5,9, 0-4,8-12.

 

 

# run at 10 pm on weekdays, annoy Joe

0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%

 

Names can also be used for the "month" and "day of week" fields. Use the first three letters of the particular day or month (case doesnât matter). Ranges or lists of names are not allowed.

Compartilhar este post


Link para o post
Compartilhar em outros sites

fiz assim e num deu muito certo não

 

o que pode ser que esta errado

 

44 10 * * * root php /srv/www/htdocs/vspan/teste_cron.php

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Consegui resolver

 

44 10 * * *  root /srv/www/htdocs/vspan/teste_cron.sh

a inves de executar o php direto, tive que executar um shell script que executa o PHP

 

 

valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

Se voce colocar isso no inicio do arquivo php, consegue executar o script sem precisar passar por um outro arquivo shell.

 

#!/usr/bin/php -q

http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif

Boa!!

 

 

não sabia disso

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.