Hello,
I have the following script which works fine when ran from the command line:
#!/apps/python/2.3.4/bin/python
import os
import sys
import time
user = os.getenv("USER")
string = time.strftime("%m%d%y0000 " + user, time.gmtime())
However, when I have this run by crontab, I get the following error:
string = time.strftime("%m%d%y0000 " + user, time.gmtime())
TypeError: cannot concatenate 'str' and 'NoneType' objects
I think it's because os.getenv("USER") is not available. Is there a way to get the username?
Thanks.