Problemas com Crontab [RESOLVIDO]

  


14. Re: Problemas com Crontab [RESOLVIDO]

Newmar Rogério
newrog

(usa Ubuntu)

Enviado em 06/10/2012 - 13:20h

amarildosertorio escreveu:

newrog escreveu:

amarildosertorio escreveu:

Tem como você postar o conteúdo do Backup_DB2.sh?


Conteúdo do Backup_DB2.sh

#!/bin/bash
db2 BACKUP DATABASE SAITO ONLINE TO /backupciss WITH 1 BUFFERS BUFFER 1024 PARALLELISM 1 INCLUDE LOGS WITHOUT PROMPTING


Quando você executa esse script na mão ele te pede senha?

Se a resposta é sim... Você tem que fazer um exporte da senha.

Para analisar os logs do cron:

# tail -1000 /var/log/cron | grep Backup_DB2.sh


[root@bdosama ~]# tail -1000 /var/log/cron | grep Backup_DB2.sh
Oct 5 12:40:01 bdosama crond[19498]: (db2inst1) CMD (db2isnt1 ./bd2/Backup_DB2. sh)
Oct 5 15:00:01 bdosama crond[20762]: (db2inst1) CMD (db2inst1 ./Backup_DB2.sh)
Oct 5 15:15:01 bdosama crond[24355]: (db2inst1) CMD (./Backup_DB2.sh)
Oct 5 15:17:02 bdosama crond[24850]: (db2inst1) CMD (db2inst1 /Backup_DB2.sh)
Oct 5 15:26:01 bdosama crond[27113]: (db2inst1) CMD (db2inst1 ./Backup_DB2.sh)
Oct 5 15:28:01 bdosama crond[27608]: (db2inst1) CMD (db2inst1 /Backup_DB2.sh)
Oct 5 15:38:01 bdosama crond[30349]: (db2inst1) CMD (/Backup_DB2.sh)
Oct 5 15:39:01 bdosama crond[30604]: (db2inst1) CMD (./Backup_DB2.sh)
Oct 5 15:41:02 bdosama crond[31194]: (db2inst1) CMD (./Backup_DB2.sh)
Oct 5 15:42:01 bdosama crond[31448]: (db2inst1) CMD (/Backup_DB2.sh)
Oct 5 15:44:01 bdosama crond[31921]: (db2inst1) CMD (/home/db2inst1/Backup_DB2. sh)
Oct 5 15:49:01 bdosama crond[704]: (root) CMD (/home/db2inst1/Backup_DB2.sh)
Oct 5 15:54:01 bdosama crond[1913]: (root) CMD (./home/db2inst1/Backup_DB2.sh)
Oct 5 16:00:01 bdosama crond[3445]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:01:01 bdosama crond[3717]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:02:01 bdosama crond[3988]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:03:01 bdosama crond[4254]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:04:01 bdosama crond[4511]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:05:01 bdosama crond[4762]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:06:01 bdosama crond[4989]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:07:01 bdosama crond[5236]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:08:01 bdosama crond[5470]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:09:01 bdosama crond[5716]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:10:01 bdosama crond[5988]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:11:01 bdosama crond[6249]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:12:01 bdosama crond[6493]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:13:01 bdosama crond[6746]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:14:01 bdosama crond[6998]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:15:01 bdosama crond[7250]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:16:01 bdosama crond[7504]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:17:01 bdosama crond[7749]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:18:01 bdosama crond[8003]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:19:01 bdosama crond[8254]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:20:01 bdosama crond[8478]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:21:01 bdosama crond[8726]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:22:01 bdosama crond[8971]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:23:01 bdosama crond[9211]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:24:01 bdosama crond[9460]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:25:01 bdosama crond[9708]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:26:01 bdosama crond[9955]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:27:01 bdosama crond[10201]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:28:01 bdosama crond[10448]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:29:01 bdosama crond[10679]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:30:01 bdosama crond[10872]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:31:01 bdosama crond[11119]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:32:01 bdosama crond[11363]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:33:01 bdosama crond[11609]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:34:01 bdosama crond[11839]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:35:01 bdosama crond[12085]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:36:01 bdosama crond[12333]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:37:01 bdosama crond[12574]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:38:02 bdosama crond[12823]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:39:01 bdosama crond[13070]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:40:01 bdosama crond[13293]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:41:01 bdosama crond[13547]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:42:01 bdosama crond[13793]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:43:01 bdosama crond[14044]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:44:01 bdosama crond[14287]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:45:01 bdosama crond[14540]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:46:01 bdosama crond[14792]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:47:01 bdosama crond[15037]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:48:01 bdosama crond[15289]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:49:01 bdosama crond[15536]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:50:01 bdosama crond[15786]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:51:01 bdosama crond[15996]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:52:01 bdosama crond[16241]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:53:01 bdosama crond[16490]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:54:01 bdosama crond[16740]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:55:01 bdosama crond[16990]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:56:01 bdosama crond[17210]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:57:01 bdosama crond[17457]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:58:01 bdosama crond[17704]: (root) CMD (./Backup_DB2.sh)
Oct 5 16:59:01 bdosama crond[17951]: (root) CMD (./Backup_DB2.sh)
Oct 5 17:41:01 bdosama crond[28287]: (db2inst1) CMD (/./Backup_DB2.sh)
Oct 5 17:43:02 bdosama crond[28784]: (db2inst1) CMD (/./Backup_DB2.sh)
Oct 5 17:48:01 bdosama crond[30032]: (root) CMD (/usr/local/sbin/Backup_DB2.sh)
Oct 5 17:51:01 bdosama crond[30737]: (root) CMD (root /usr/local/sbin/Backup_DB 2.sh ./Backup_DB2.sh)
Oct 6 10:00:01 bdosama crond[4367]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:01:01 bdosama crond[4633]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:02:01 bdosama crond[4858]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:03:01 bdosama crond[5106]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:04:01 bdosama crond[5354]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:05:01 bdosama crond[5603]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:06:01 bdosama crond[5875]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:07:01 bdosama crond[6137]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:08:01 bdosama crond[6386]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:09:01 bdosama crond[6632]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:10:01 bdosama crond[6884]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:11:01 bdosama crond[7112]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:12:01 bdosama crond[7372]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:13:01 bdosama crond[7621]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:14:01 bdosama crond[7866]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:15:02 bdosama crond[8121]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:16:01 bdosama crond[8375]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:17:01 bdosama crond[8622]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:18:01 bdosama crond[8870]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:19:01 bdosama crond[9116]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:20:01 bdosama crond[9366]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:21:01 bdosama crond[9616]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:22:01 bdosama crond[9837]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2. sh)
Oct 6 10:23:01 bdosama crond[10070]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:24:01 bdosama crond[10319]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:25:01 bdosama crond[10566]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:26:01 bdosama crond[10820]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:27:01 bdosama crond[11075]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:28:01 bdosama crond[11332]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:29:01 bdosama crond[11580]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:30:01 bdosama crond[11834]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:31:01 bdosama crond[12081]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:32:01 bdosama crond[12331]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:33:01 bdosama crond[12557]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:34:01 bdosama crond[12804]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:35:01 bdosama crond[13055]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:36:01 bdosama crond[13298]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:37:01 bdosama crond[13552]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:38:01 bdosama crond[13800]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:39:01 bdosama crond[14048]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:40:01 bdosama crond[14297]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:41:01 bdosama crond[14546]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:42:01 bdosama crond[14794]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:43:01 bdosama crond[15041]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:44:01 bdosama crond[15267]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:45:01 bdosama crond[15516]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:46:01 bdosama crond[15766]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:47:01 bdosama crond[16014]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:48:01 bdosama crond[16259]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:49:01 bdosama crond[16513]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:50:01 bdosama crond[16759]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:51:01 bdosama crond[17007]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:52:01 bdosama crond[17259]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:53:01 bdosama crond[17508]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:54:01 bdosama crond[17735]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:55:01 bdosama crond[17986]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:56:01 bdosama crond[18233]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:57:01 bdosama crond[18478]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:58:01 bdosama crond[18727]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
Oct 6 10:59:01 bdosama crond[18974]: (db2inst1) CMD (/usr/local/sbin/Backup_DB2 .sh)
[root@bdosama ~]#



15. Re: Problemas com Crontab [RESOLVIDO]

Newmar Rogério
newrog

(usa Ubuntu)

Enviado em 06/10/2012 - 14:06h

amarildosertorio escreveu:

newrog escreveu:

amarildosertorio escreveu:

Tem como você postar o conteúdo do Backup_DB2.sh?


Conteúdo do Backup_DB2.sh

#!/bin/bash
db2 BACKUP DATABASE SAITO ONLINE TO /backupciss WITH 1 BUFFERS BUFFER 1024 PARALLELISM 1 INCLUDE LOGS WITHOUT PROMPTING


Quando você executa esse script na mão ele te pede senha?

Se a resposta é sim... Você tem que fazer um exporte da senha.

Para analisar os logs do cron:

# tail -1000 /var/log/cron | grep Backup_DB2.sh


Quando executo direto não pede senha. Mais tem que ser o usuário db2inst1


16. Re: Problemas com Crontab [RESOLVIDO]

Josenildo Cardoso
dungamaster

(usa Debian)

Enviado em 06/10/2012 - 23:39h

Só uma observação, quando vc moveu o script para a pasta sbin, ficou um espaço no nome do script segundo o log do cron, ficou
backup. sh, um espaço depois do ".", tenta corrigir.


17. Re: Problemas com Crontab [RESOLVIDO]

Josenildo Cardoso
dungamaster

(usa Debian)

Enviado em 06/10/2012 - 23:39h

Só uma observação, quando vc moveu o script para a pasta sbin, ficou um espaço no nome do script segundo o log do cron, ficou
backup. sh, um espaço depois do ".", tenta corrigir.


18. Re: Problemas com Crontab [RESOLVIDO]

Newmar Rogério
newrog

(usa Ubuntu)

Enviado em 08/10/2012 - 09:14h

dungamaster escreveu:

Só uma observação, quando vc moveu o script para a pasta sbin, ficou um espaço no nome do script segundo o log do cron, ficou
backup. sh, um espaço depois do ".", tenta corrigir.


Verifiquei, não tem espaços... acho que na hora de copiar via Putty que ficou os espaços.


19. Re: Problemas com Crontab [RESOLVIDO]

Newmar Rogério
newrog

(usa Ubuntu)

Enviado em 22/10/2012 - 08:15h

CONTINUO SEM CONSEGUIR EXECUTAR O ARQUIVO PELO CRONTAB SE TIVEREM MAIS DICAS DE COMO FAZER EU AGRADEÇO.





01 02



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts