autorep command(belongs to autosys) not executing in crontab. Why? [duplicate]
This question already has an answer here:
CronJob not running
8 answers
Below is my cron entry:
#!/bin/bash
09 01 * * * /home/c/charlesp/jobs.sh > /home/c/charlesp/jobs1.log 2>&1
which gives me only the error output, but not the actual output for which the script is written. The script is working fine and giving desired output when it is executed directly, but not in cron. When it is running in crontab, the error given is below. Please help. The errors are only coming when I run them in cron; not outside of cron.
Errors:
1.When i give autorep command directly in the script:
/home/c/charlesp/jobs.sh: line 3: autorep: command not found
2.When i give autorep command along with absolute path in the script:
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep: error while loading shared libraries: libascmn.so: cannot open shared object file: No such file or directory
My script is below:
Only autorep command:
#!/usr/local/bin/bash
autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
With absolute path :
#!/usr/local/bin/bash
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
bash cron
marked as duplicate by Conner, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 7:49
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
CronJob not running
8 answers
Below is my cron entry:
#!/bin/bash
09 01 * * * /home/c/charlesp/jobs.sh > /home/c/charlesp/jobs1.log 2>&1
which gives me only the error output, but not the actual output for which the script is written. The script is working fine and giving desired output when it is executed directly, but not in cron. When it is running in crontab, the error given is below. Please help. The errors are only coming when I run them in cron; not outside of cron.
Errors:
1.When i give autorep command directly in the script:
/home/c/charlesp/jobs.sh: line 3: autorep: command not found
2.When i give autorep command along with absolute path in the script:
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep: error while loading shared libraries: libascmn.so: cannot open shared object file: No such file or directory
My script is below:
Only autorep command:
#!/usr/local/bin/bash
autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
With absolute path :
#!/usr/local/bin/bash
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
bash cron
marked as duplicate by Conner, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 7:49
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
By default, cron jobs run with a really minimal environment. You probably need to setPATH
andLD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.
– Gordon Davisson
Nov 27 '18 at 5:59
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05
add a comment |
This question already has an answer here:
CronJob not running
8 answers
Below is my cron entry:
#!/bin/bash
09 01 * * * /home/c/charlesp/jobs.sh > /home/c/charlesp/jobs1.log 2>&1
which gives me only the error output, but not the actual output for which the script is written. The script is working fine and giving desired output when it is executed directly, but not in cron. When it is running in crontab, the error given is below. Please help. The errors are only coming when I run them in cron; not outside of cron.
Errors:
1.When i give autorep command directly in the script:
/home/c/charlesp/jobs.sh: line 3: autorep: command not found
2.When i give autorep command along with absolute path in the script:
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep: error while loading shared libraries: libascmn.so: cannot open shared object file: No such file or directory
My script is below:
Only autorep command:
#!/usr/local/bin/bash
autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
With absolute path :
#!/usr/local/bin/bash
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
bash cron
This question already has an answer here:
CronJob not running
8 answers
Below is my cron entry:
#!/bin/bash
09 01 * * * /home/c/charlesp/jobs.sh > /home/c/charlesp/jobs1.log 2>&1
which gives me only the error output, but not the actual output for which the script is written. The script is working fine and giving desired output when it is executed directly, but not in cron. When it is running in crontab, the error given is below. Please help. The errors are only coming when I run them in cron; not outside of cron.
Errors:
1.When i give autorep command directly in the script:
/home/c/charlesp/jobs.sh: line 3: autorep: command not found
2.When i give autorep command along with absolute path in the script:
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep: error while loading shared libraries: libascmn.so: cannot open shared object file: No such file or directory
My script is below:
Only autorep command:
#!/usr/local/bin/bash
autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
With absolute path :
#!/usr/local/bin/bash
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
This question already has an answer here:
CronJob not running
8 answers
bash cron
bash cron
edited Nov 27 '18 at 1:51
Conner
23.4k84568
23.4k84568
asked Nov 27 '18 at 1:45
Prince CharuPrince Charu
52
52
marked as duplicate by Conner, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 7:49
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Conner, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 7:49
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
By default, cron jobs run with a really minimal environment. You probably need to setPATH
andLD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.
– Gordon Davisson
Nov 27 '18 at 5:59
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05
add a comment |
By default, cron jobs run with a really minimal environment. You probably need to setPATH
andLD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.
– Gordon Davisson
Nov 27 '18 at 5:59
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05
By default, cron jobs run with a really minimal environment. You probably need to set
PATH
and LD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.– Gordon Davisson
Nov 27 '18 at 5:59
By default, cron jobs run with a really minimal environment. You probably need to set
PATH
and LD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.– Gordon Davisson
Nov 27 '18 at 5:59
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05
add a comment |
1 Answer
1
active
oldest
votes
As stated by Gordon, cron run with a minimal environment.
For Error 1:
First of all, we need to use absolute paths for everything in the script which we keep as cron entry. So complete path is given in the script like below.
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
Got error 2 here.
For Error 2:
Since libascmn.so is unavailable, we need to export that path where libascmn.so is present to LD_LIBRARY_PATH like below.
-bash-4.3$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/CA/WorkloadAutomationAE/autosys/lib
Got error 3 here.
For Error 3:
Below is the error:
Resource bundle is not available while looking for key="CAUAJM_E_80003".
For this, we need to source the environment of autosys like below.
-bash-4.3$ . /opt/CA/WorkloadAutomationAE/autouser.TQ1/autosys.sh.automgmtq1
Now, even if it does not work with .sh script, change it to .csh script.
Now the script will work like a charm in Cron.
Thank You. :)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As stated by Gordon, cron run with a minimal environment.
For Error 1:
First of all, we need to use absolute paths for everything in the script which we keep as cron entry. So complete path is given in the script like below.
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
Got error 2 here.
For Error 2:
Since libascmn.so is unavailable, we need to export that path where libascmn.so is present to LD_LIBRARY_PATH like below.
-bash-4.3$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/CA/WorkloadAutomationAE/autosys/lib
Got error 3 here.
For Error 3:
Below is the error:
Resource bundle is not available while looking for key="CAUAJM_E_80003".
For this, we need to source the environment of autosys like below.
-bash-4.3$ . /opt/CA/WorkloadAutomationAE/autouser.TQ1/autosys.sh.automgmtq1
Now, even if it does not work with .sh script, change it to .csh script.
Now the script will work like a charm in Cron.
Thank You. :)
add a comment |
As stated by Gordon, cron run with a minimal environment.
For Error 1:
First of all, we need to use absolute paths for everything in the script which we keep as cron entry. So complete path is given in the script like below.
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
Got error 2 here.
For Error 2:
Since libascmn.so is unavailable, we need to export that path where libascmn.so is present to LD_LIBRARY_PATH like below.
-bash-4.3$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/CA/WorkloadAutomationAE/autosys/lib
Got error 3 here.
For Error 3:
Below is the error:
Resource bundle is not available while looking for key="CAUAJM_E_80003".
For this, we need to source the environment of autosys like below.
-bash-4.3$ . /opt/CA/WorkloadAutomationAE/autouser.TQ1/autosys.sh.automgmtq1
Now, even if it does not work with .sh script, change it to .csh script.
Now the script will work like a charm in Cron.
Thank You. :)
add a comment |
As stated by Gordon, cron run with a minimal environment.
For Error 1:
First of all, we need to use absolute paths for everything in the script which we keep as cron entry. So complete path is given in the script like below.
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
Got error 2 here.
For Error 2:
Since libascmn.so is unavailable, we need to export that path where libascmn.so is present to LD_LIBRARY_PATH like below.
-bash-4.3$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/CA/WorkloadAutomationAE/autosys/lib
Got error 3 here.
For Error 3:
Below is the error:
Resource bundle is not available while looking for key="CAUAJM_E_80003".
For this, we need to source the environment of autosys like below.
-bash-4.3$ . /opt/CA/WorkloadAutomationAE/autouser.TQ1/autosys.sh.automgmtq1
Now, even if it does not work with .sh script, change it to .csh script.
Now the script will work like a charm in Cron.
Thank You. :)
As stated by Gordon, cron run with a minimal environment.
For Error 1:
First of all, we need to use absolute paths for everything in the script which we keep as cron entry. So complete path is given in the script like below.
/opt/CA/WorkloadAutomationAE/autosys/bin/autorep -j ALL -L0 | grep -w RU > /home/c/charlesp/jobs.txt
Got error 2 here.
For Error 2:
Since libascmn.so is unavailable, we need to export that path where libascmn.so is present to LD_LIBRARY_PATH like below.
-bash-4.3$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/CA/WorkloadAutomationAE/autosys/lib
Got error 3 here.
For Error 3:
Below is the error:
Resource bundle is not available while looking for key="CAUAJM_E_80003".
For this, we need to source the environment of autosys like below.
-bash-4.3$ . /opt/CA/WorkloadAutomationAE/autouser.TQ1/autosys.sh.automgmtq1
Now, even if it does not work with .sh script, change it to .csh script.
Now the script will work like a charm in Cron.
Thank You. :)
answered Nov 27 '18 at 7:28
Prince CharuPrince Charu
52
52
add a comment |
add a comment |
By default, cron jobs run with a really minimal environment. You probably need to set
PATH
andLD_LIBRARY_PATH
, and maybe other things. Some previous similar questions are here and here.– Gordon Davisson
Nov 27 '18 at 5:59
Thanks Gordon. I resolved this via unix.com/shell-programming-and-scripting/… and comm.support.ca.com/kb/…
– Prince Charu
Nov 27 '18 at 7:05