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 :

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

And here is the error message

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

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.