cancel
Showing results for 
Search instead for 
Did you mean: 

bpimagelist gives different output

Sid1987
Level 6
Certified

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

6 REPLIES 6

sdo
Moderator
Moderator
Partner    VIP    Certified

Is the crontab job running as a different userid?

Maybe there is a coding error in your .profile file?

Sid1987
Level 6
Certified

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.

sdo
Moderator
Moderator
Partner    VIP    Certified

Does your crontab based script use a shebang?

https://en.wikipedia.org/wiki/Shebang_(Unix)

quebek
Moderator
Moderator
   VIP    Certified

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....

Nicolai
Moderator
Moderator
Partner    VIP   

My guess is that the locale (time zone/keyboard definition) is diffrent.

Sid1987
Level 6
Certified

@quebek

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