If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > crontab db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-03, 01:52
jagan_5378 jagan_5378 is offline
Registered User
 
Join Date: Nov 2003
Posts: 68
crontab db2

hi to all


I have seen this error in the db2 forum but not a finalized resolution

SQL10007N Message "-1390" could not be retrieved.

here is my problem:

I am using Udb 7.2 on Red Hat Linux v6.2.

I created a crontab entry for my script under the db2 user.

crontab entry:

37 16 * * 1-5 /kal/db2inst1/db2_backup

where dia_backup is my script.

Contents of the dia_backup script:


/home/db2inst3/sqllib/bin/db2 force applications all
/home/db2inst3/sqllib/bin/db2 backup db dia to '/data/arraya/bck'


Whenever the job is executed from the crontab it fails with the above error.

If I run the script from the os command line it works.

Any suggestions?

NOTE:
I verified that my DB2INSTANCE paramter is set and I have also
checked the file permissions for where the backup file is
suppose to end up.


pl tell me...
Reply With Quote
  #2 (permalink)  
Old 12-05-03, 02:30
jammann jammann is offline
Registered User
 
Join Date: Jul 2003
Location: Switzerland, Basle
Posts: 10
did you verify the DB2INSTANCE is set WITHIN the scope of the crontab-script ? (or did you only check on the commandline ?)

i suggest to extend your script to check it out
----------------------------------
echo "DB2INSTANCE is: $DB2INSTANCE" > /tmp/db2_backup.log
home/db2inst3/sqllib/bin/db2 force applications all
/home/db2inst3/sqllib/bin/db2 backup db dia to '/data/arraya/bck'
----------------------------------
Reply With Quote
  #3 (permalink)  
Old 12-05-03, 08:19
quigleyd quigleyd is offline
Registered User
 
Join Date: Nov 2002
Location: Delaware
Posts: 186
You need to set your environment variables, I would put the command in a script, that loads your profile then just execute the script.


load env variables
run commands
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On