crontab problem

hi..

i have a program (tf.sh), and i want what it runs automatically with a "lapsus" of 2 hours. (1,3,5,7,9,11,13,15,17,19,21,23 hrs.)

i know what i have to do it using crontab, but i don�t know how to do it.

i have the next idea, but the problem is what it doesn�t run on my server (solaris 5.7):

0 1,3,5,7,9,11,13,15,17,19,21,23 * * * /sybase/TRANSFERENCIA_FTP/tf.sh 2>/tmp/.ftp.log.2 1>/tmp/.ftp.log.1

please help me - any idea
thanks
jona

You need one more asterisk in there.

From the crontab man page:

why do you said that i need another asterisk?

please, explain me ... i don�t know how to use crontab

thanks

My mistake, you don't need another asterisk. At first glace it seemed like you were missing a field.

Do you get any output into the files /tmp/.ftp.log.1 and /tmp/.ftp.log.2? Can you check if there are error messages in the cron log?

Is cron running? Type ps -ef | grep cron and post the output.

dangral was mistaken - he missed the leading 0 - you might want to put in
00 instead so others won't mistake it.

00 1,3,5,7,9,11,13,15,17,19,21,23 * * * /sybase/TRANSFERENCIA_FTP/tf.sh 2>/tmp/.ftp.log.2 1>/tmp/.ftp.log.1

instead of

0 1,3,5,7,9,11,13,15,17,19,21,23 * * * /sybase/TRANSFERENCIA_FTP/tf.sh 2>/tmp/.ftp.log.2 1>/tmp/.ftp.log.1

And I assume since this is started from /sybase, you require some of the env variables associated with Sybase. If you can run it from the command line and it works, then do the env command to find any sybase variables that will need to be set up in the tf.sh script to get it to work.

i don`t get any output into the files /tmp/.ftp.log.1 and /tmp/.ftp.log.2
is more, they don�t exist in the /temp folder

i put the command and this is the exit:
data:sybase>ps -e|grep cron

10564 pts/7 S 0:00 grep cron =/usr/bin/grep ASTMP=/sybase/CATALOGO _INIT

what does this mean? how can i do it again this crontab?

DebianJ, you are using /usr/ucb/ps. You need to use /usr/bin/ps to do what RTM asked.

Jona, creo que hablas espa�ol, explicame en espa�ol un poco mejor tu problema y en que te encuentras parado(a) para ver si te puedo dar una manito, bye.

PD: La recomendacion de arriba es cierta, el crontab acepta las entradas de fechas y horas con dos digitos, es decir, utiliza 00 01 02 03 etc.

Lestat

Lestat - Whilst it is understandable that English is not the first language of some of our posters, you should use it for technical discussion within these forums.

Please review the rules.

Thanks,
ZB

I just want to help Jona, but no problem ill use english in next times.

Hi,

Can you please check the cron log file and what is the exit status given for the mentioned jobs ?
check if this job is eecuted in cron and get the exit status.
also try running the script with all the options you specified in the crontab on command line and check whether its running or not. Then do let us know what is the output.

After you edit the cron table: crontab -e
you as a superuser will then have to restart the cron by.

  1. go to /etc/cron.d (solaris 5.+)
  2. find a file FIFO and remove it.
  3. type
    ps -ef | grep cron # to find cron process id.
  4. kill the cron process.
    kill -9 <cron process id>
  5. start "cron" deamon.
    /usr/sbin/cron
  6. check whether there is the FIFO file in /etc/cron.d and the new cron process id appear.

The modification on crontab table will not activate with out restart it.