LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   schedule job to be run at 8:00pm every night (https://www.linuxquestions.org/questions/linux-general-1/schedule-job-to-be-run-at-8-00pm-every-night-107576/)

Dr.Fark 10-23-2003 05:04 PM

also you could place a script in /etc/cron.hourly that looks somthing like this:
#!/bin/sh

time=`/bin/date +%K`
if [ $time = "20" ]; then
`/home/oracle/DBA_STUFFS/backup_scripts/TEST/backupTEST.sh`
fi
#####

I think that the output from anything run in `` will go to syslog, and end up in /var/log/messages but I'm not 100% sure,

ashley75 10-24-2003 09:40 AM

thanks for your reply.

I got my scripts working now when I run ./backup_TEST.sh manually.


but when I put in cron job to be run as schedule, I use crontab -e and put the job in there as scheduled time and I got the error on the mail:

From: root@localhost.localdomain (Cron Daemon)
To: oracle@localhost.localdomain
Subject: Cron <oracle@qhoudb03> /home/oracle/scripts/backup/TEST/backup_TEST.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/oracle>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=oracle>

/home/oracle/scripts/backup/TEST/backup_TEST.sh: exp: command not found

From oracle Fri Oct 24 11:03:01 2003
Return-Path: <oracle@localhost.localdomain>
Received: (from oracle@localhost)
by localhost.localdomain (8.11.6/8.11.6) id h9OH31M26811
for oracle; Fri, 24 Oct 2003 11:03:01 -0600
Date: Fri, 24 Oct 2003 11:03:01 -0600
Message-Id: <200310241703.h9OH31M26811@localhost.localdomain>
From: root@localhost.localdomain (Cron Daemon)
To: oracle@localhost.localdomain
Subject: Cron <oracle@qhoudb03> /home/oracle/scripts/backup/TEST/backup_TEST.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/oracle>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=oracle>

/home/oracle/scripts/backup/TEST/backup_TEST.sh: exp: command not found


COULD SOMEONE PLEASE HELP ME WHAT I DID WRONG ON THE CRON JOB????

THANKS

Blinker_Fluid 10-24-2003 11:15 AM

What is 'exp'? I don't believe it is a standard Linux command.
If you have an alias set up in your .bashrc that isn't defined in the script then you will get command not found.
Some things to try:
which exp <-- should return something substitute the returned value for exp in your script (unless it's not found)
If that doesn't give you anything type: 'alias' is there an alias set up for exp?

marist89 10-24-2003 11:19 AM

Your environment is not setup correctly. I would either setup your environment before you call the script or set it up inside the script.

marist89 10-24-2003 11:23 AM

http://www.linuxquestions.org/questi...hreadid=101349

ashley75 10-24-2003 12:40 PM

Binker_fluid,

Sorry, since I am new so I am not clear of what you are trying to explain here.

As I mentioned earlier, I was able to run the script by simple type ./backup_TEST.sh


you mentioned about alias, how come when I type exp manually, it ran fine, maybe something I don't know or understand, I know alias but in my case what I need to set it to????


Marsit89,

Are you Jeff???? by the way, do you have any advises???? I know you are expert in Oracle if you are Jeff. and thanks so much for your help

unSpawn 10-24-2003 12:42 PM

//moderator.note: as noted by marist89, this thread is a dup so it gets closed.
FUP to: http://www.linuxquestions.org/questi...hreadid=101349

trickykid 10-24-2003 12:44 PM

Quote:

Originally posted by unSpawn
//moderator.note: as noted by marist89, this thread is a dup so it gets closed.
FUP to: http://www.linuxquestions.org/questi...hreadid=101349

Instead I merged them as I've made ashley75 well aware about creating new threads on existing topics when asking questions.

Lets keep discussions in the existing threads you create please or it causes confusion.

If your unsure if you already asked it once here as you might visit multiple forums, search before posting again as you might already have responses.

Regards.


All times are GMT -5. The time now is 03:22 AM.