The @ goes at the beginning of the line...
I thought you wrote this script? Are you even looking at the errors you're seeing? |
can anyone assist here/
|
Hi suicidaleggroll,
Can you please have a look error, changes been done in script as suggested. |
KISS
It's a rough sketch, but maybe this will be of some help.
Not sure if it will work so please test safely. :D There are three files to modify/create: (1) /etc/crontab (2) /home/oracle/my_cron_script.bash (3) /home/oracle/my_cron.sql (4) /home/oracle/my_cron_script.log The fourth is a log file produced by the my_cron_script.bash -unimatrixdoc ######################################### # FILENAME: /etc/crontab ######################################### Code:
# Man page for crontab: # FILENAME: /home/oracle/my_cron_script.bash ######################################### Code:
#!/bin/bash # FILENAME: /home/oracle/my_cron.sql # NOTE: put a fullpath to # extract_data.sql location ######################################### Code:
CONNECT user/user_1234@CBDTEST |
Fix
I ran into this today. Using a couple of links around the internet I found the solution to be as follows:
Edit your crontab so it looks like this: SHELL=/bin/bash */15 * * * * . /home/HomeFolder/.profile; cd /directory/of/your/script; ./runScript.sh > /dev null 2>&1 Please note the . before the full path to your profile. This for me worked while everything else did not. What is happening is bash does not run in an environment by default. So as you have tried and failed (as did I) you have to setup your environment variables manually. I could not get mine to work right either with sqlplus so I used this. It declares that you run all cronjobs in a bash environment, it sources your .profile, changes the directory to the directory of your script, then runs your script. You may not need to cd like I did. I have some other scripts that need to be called from the same directory. Can't hurt anything by using the cd command. Hope this helps. |
All times are GMT -5. The time now is 03:40 AM. |