My active tickets will not be available in the cron environment


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting My active tickets will not be available in the cron environment
# 1  
Old 11-13-2017
My active tickets will not be available in the cron environment

Hi everybody ,

when I run a script from the command line it works but returns a failure if I run it from crontab.
Basically I wanted to send a file to hdfs,
I thought it was related to the fact that crontab do not know the path to hdfs so I put the full path but it still does not work: here is the piece of code that fails :

Code:
/usr/bin/hdfs dfs -put -f  $source_directory/$file $hdfs_target_directory

And here is the error message

Code:
put: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed 
[Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]; 
 Host Details : local host is: "aocsv155bed0p.foo.acme.net/10.12.11.133"; 
destination host is: "aocsv155bna1p.foo.acme.net":8020;

My interactive environment and my cron environment are different.
my active tickets will not be available in the cron environment.

I need to save the kerberos ticket in such a way my script can pick it up, using kinit in my script.

How to do that ? thanks in advance

Moderator's Comments:
Mod Comment Thanks for adding code tags. Added line breaks in code .... Please break long lines in code tags to avoid our need to add code wrap css to the code tags Smilie
# 2  
Old 11-13-2017
This is a duplicate thread.

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run script through cron with user environment variables

Hi everyone, I wrote a script that is supposed to be run by cron on a daily basis. It works just fine if I run it manually, but due to a lack of environment variables (which are available during my user session but not when cron runs the script) it keeps failing to run successfully. Here's the... (2 Replies)
Discussion started by: gacanepa
2 Replies

2. Shell Programming and Scripting

Cron not inherting the environment in solaris 2.5.1

Solaris 2.5.1 I have written a shell script that creates a tar file and then ftp's the file to an other box. The shell script perfectly executes when run manually through terminal. But when i schedule it through cron, its not executing and showing exit code RC =1 in cron log. I have added the... (3 Replies)
Discussion started by: venu
3 Replies

3. Solaris

Environment variables and cron

where do you set environment variables for cron jobs? I have a feeling it would ignore ~/.bashrc ? thanks. (2 Replies)
Discussion started by: orange47
2 Replies

4. Shell Programming and Scripting

Setting environment variables in Cron file

Hi, In Cron file i'm using username and password hard-coded and now i wann to use environmental veraiables in cron file. But Could you please guide me how to use these environmental variables in cron file ? Thanks, Shyamu.A (4 Replies)
Discussion started by: shyamu544
4 Replies

5. Solaris

Solaris live upgrade on Active boot environment

Hi, Is it possible to perform an luupgrade on the active boot environment in Solaris? I want to perform this on BEAlpha - the disk that has BEOmega will be unavailable whilst performing the upgrade but I still want to install the patches using luupgrade. Boot Environment Is... (4 Replies)
Discussion started by: Mr_Webster
4 Replies

6. Solaris

Setting environment variables within cron jobs!!

Is it possible to use environment variables within cron jobs. I am using a cron job to run a c program at regular intervals. The C program uses a library and i have set the library path in the LD_LIBRARY_PATH environment variable. But when i ran the job i got the error library not found!! Any... (1 Reply)
Discussion started by: atheek
1 Replies

7. UNIX for Dummies Questions & Answers

Cron Environment

I am trying to run a series of perl scripts at different times using crontab under solaris. The scripts that i am using require some specific environment variables to be specified for database functionality, but i would also like it that i can specify a few global variables for output locations. ... (8 Replies)
Discussion started by: Smitty McSmith
8 Replies
Login or Register to Ask a Question