I don't need to run any commands after logging in before manually running the job for it to work.
How can I tell what an executable job is doing? I know it would help solve this if I had that information, but I don't know how to check, since it isn't a text file.
You don' t need to run any of those commands manually after logging in because logging in runs those commands automatically before you see your first shell prompt. But, when you run a job with cron you don't login and your script has to do whatever it takes to create an environment in which the processes started by your script running under cron have the environment they need to get their work done.
As Jim McNamara suggested, create the following script in a file named get_cron_env:
Make that file executable with:
Set a crontab entry to run that script (using an absolute pathname for the script; not just get_cron_env).
And then run the commands:
and show us the output.
There will likely be some differences because interactive environments have more stuff going on than background jobs like those started by cron. But, maybe we'll get lucky and see something that you can easily fix.
I can't help you find the source for the executable you have installed as /opt/CPsuite-R77/fw1/bin/upgrade_tools/upgrade_expor. If you (the royal you meaning some administrator inside your company) wrote software and didn't provide documentation on how to run it, track down who wrote it and get them to tell you exactly what you have to do to run it from cron.
If this is third party software you bought from someone else, read the documentation that came with it. If you bought code from someone and didn't get documentation that tells you how to run it; shame on you. Contact the vendor and ask for support.
If this is third party software you downloaded free from someone else, read the documentation that came with it. If you downloaded code without documentation and without source, and without support; you've got what you paid for and I wish you luck. If you downloaded free source, look at it and figure out what it is doing that keeps it from working under cron and fix it. Or send mail to the support site for that free software and ask for help.
And, of course, if you downloaded a bootlegged copy of someone's software from a black site, we have absolutely no sympathy for you and will not further assist you in trying to fix code you stole from its creators. (But, we assume that you would never do that.)
Hi All,
Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea?
This is what I have under root crontab...
00 18 * * 1-5... (4 Replies)
I have made a script to execute an IDL routine with the purpose to plot data on a fixed time.
The problem is that when I include this script in the crontab to run it every night, the IDL part doesn't work (the other commands, like getting data from the database, are carried out though).
This... (4 Replies)
Hi all
I have this inside a shell script (bash):
cd DIRECTORY
find . -maxdepth 1 | sed 's#./##' | /usr/bin/xargs -I '{}' chown -Rv '{}' /DIRECTORY/'{}'
All the directories in this location are named after usernames, so it simply sets the owner to that of the username of the folder.
It... (5 Replies)
Hello all,
I'm new here and have a question if you don't mind helping me. I have a script that will work if I kick if off manually but not from Cron. My cron entry is this:
05,20,35,50 * * * * /scripts/status.sh > /dev/null 2>&1
The first script (works fine) is this:
#!/bin/sh
#
#... (14 Replies)
hello,
i recently switched to a new ec2 box and transferred the cronjobs from the old box. For some reason one of the scripts won't work but it runs manually from the command line. I've read from previous threads it might be an environment issue but I added a line with the path to the script... (2 Replies)
Hello Guys,
I have scratched my head alot on this but couldn't find clue what's wrong. Can you please help me with this? My problem is as following.
1) When I manually execute following script it runs successfully with below output.
bash-3.00# more smssend
#!/bin/bash
echo -e "<Request... (16 Replies)
Hello Team,
As a part of my job we have made a script to automate a service to restart frequently.
Script having two functions when executing it's should find the existing service and kill it, then start the same service . Verified the script it's working fine when executing... (18 Replies)
Hello Gurus,
I have written small script which will start the given service if its stop .Its running fine when manually executed but its unable to run from crontab.
#!/bin/bash
SERVICENAME=rsyslog
service $SERVICENAME status > /dev/null
SYSLOGSTATUS=`echo $?`
COUNT=0
THRESHOLD=3
if ... (4 Replies)
Hi Guys,
I am executing the script called Delet.sh manually it is successfully completing the task but it is failing to run vi cron tab, I tried to pass PATH & .profile before execution but no luck, Any suggestions?
Script below
#!/usr/bin/ksh
#set -x
# Purpose : Delete folders file from... (9 Replies)
Hi,
I "borrowed" a script I found online, to start a SAP router application on a Solaris 11 (SPARC) server.
The script runs fine when calling it manually, but when I schedule it to run from cron, it doesn't. I don't see any warning or failure messages anywhere, just nothing happens.
... (11 Replies)