08-10-2017 11:02 PM
Hi Everyone,
I just notices, bpimagelist -client <> -policy <> -hoursago <> -idonly gives different output display when run on prompt and from crontab.
actually date format is different in display which had me change the script parameter.
from crontab
head -10 /tmp/backup_image_info_backupid
Time: Sun Aug 6 11:01:56 2017 ID: xyz_1502010116 FULL (0)
Time: Sun Aug 6 11:01:55 2017 ID: xyz_1502010115 FULL (0)
Time: Sun Aug 6 11:01:54 2017 ID: xyz_1502010114 FULL (0)
Time: Thu Aug 3 03:00:46 2017 ID: xyz_1501722046 FULL (0)
Time: Thu Aug 3 03:00:44 2017 ID: xyz_1501722044 FULL (0)
From command line
Time: Thu 03 Aug 2017 12:15:21 AM CA ID: xyz_1501712121 FULL (0)
Time: Thu 03 Aug 2017 12:12:28 AM CA ID: xyz_1501711948 FULL (0)
Time: Thu 03 Aug 2017 12:00:39 AM CA ID: xyz_1501711239 FULL (0)
Time: Mon 03 Jul 2017 12:00:26 AM CA ID: xyz_1499032826 FULL (0)
Time: Mon 03 Jul 2017 12:00:25 AM CA ID: xyz_1499032825 FULL (0)
Can I change it to have same display everytime? Either of them
08-10-2017 11:49 PM
Is the crontab job running as a different userid?
Maybe there is a coding error in your .profile file?
08-11-2017 12:10 AM
It's running with same id, I am running same command from my script on prompt it gives me different output and when run in script from crontab it gives different output. Interesting part is script runs perfection from prompt if I use bpimagelist prompt output, However when run through crontab it gives different output. I am using ksh, I am guessing it has something to do with shell which is running the script. prompt default shell is bash, crontab default is sh and in my script i am using ksh. I tried specifying the shell in crontab against my script, still nothing.
08-11-2017 12:16 AM
Does your crontab based script use a shebang?
08-11-2017 12:21 AM
Hi
Intersting...
Can you please execute command set from command prompt and then from crontab - and in both cases redirect to file
ie. set > cmd_prompt.out and set > crontab.out
maybe there will be some differences visible....
08-11-2017 06:06 AM
My guess is that the locale (time zone/keyboard definition) is diffrent.
08-17-2017 06:48 AM
I did that only in my comment above, they are the output from same file just with different method which is crontab and command prompt