Cron Job Não está em execução após a configuração adequada

0

Então criei um cron job como mostrado abaixo:

  GNU nano 2.2.6                    File: /tmp/crontab.uNoEXy/crontab

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
*/3 *  *    *   *    /home/kyle/runBackup.sh

Qual, para um teste - executa o script conforme indicado a cada três minutos. Sim, verificando o var/log/syslog - não há cron run para hoje. A evidência deste cron executando é um arquivo .tar.gz na minha pasta dropbox - que, se você executar o script, acontece. É só colocá-lo em um cron que nada acontece.

    
por LogicLooking 30.10.2013 / 18:43

2 respostas

0

Experimente:

*/3 * * * * /home/kyle/runBackup.sh
% bl0ck_qu0te%

Para mais detalhes, consulte: link

    
por Radu Rădeanu 30.10.2013 / 18:58
0

Eu tive um problema muito parecido e notei que depois que o trabalho estava agendado para ser executado, o correio estava sendo colocado em / var / spool / mail para root, é o crontab de raiz em que o job foi colocado, dizendo que a raiz o usuário não tinha permissão para executar o trabalho. Será que alguém olhou ao redor e acabou por ser devido ao script de destino não ser executável. Se você fizer:

ls -la /home/kyle/

e o runBackup.sh mostra as permissões -rw-r - r-- e tente:

chmod +x /home/kyle/runBackup.sh

que deve fazer as permissões -rwxr-xr-x e permitir que o trabalho seja executado.

Material de origem

    
por user305797 15.07.2014 / 18:14