There is no tty, no /dev/tty, no controlling terminal. You can create one in several ways, like ssh -tt and expect, but usually one does not want terminal output from a cron job.
You have to build the environment manually, and if you were not careful writing your ~/.profile, it may want a tty. Without the usual PATH, LD_LIBRARY_PATH, etc. many apps fail.
Execuatble scripts should be set up according to man exec to run under the right interpreter. Cron will call scripts using sh, and if you lack exec permissions or first line is not:
then you are in trouble.
I often test run cron script lines using something like:
(no terminal, called from sh).
Hello,
I'm stuck and confused as to why when I execute things form the command line it works but when in a script it doesn't.
My script:
### creating a lock on the console
touch /var/run/console.lock
chmod 600 /var/run/console.lock
echo "$User" >>... (2 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hey there, I'm a total newbie unix guy here and just picking this stuff up. Have a very small script I put together that works fine from the command line but not once I put it in a cron job. Searched and found this thread and am wondering it it has something to do with setting variables, though the... (7 Replies)
I have a script which runs fine through command line, but doesn't run through cron. There are some variables which are set by the .profile file which are used by the script. Is it that cront does not pick these variables.
$/export/home/rahul/bin/createfile.sh >>... (3 Replies)
Hi, I'm new to these forums, and I'm hoping that someone can solve this problem...
To make things short:
I have DD-wrt set up on a router.
I'm trying to run a script in CRON that fetches the daily password from my database using SSH.
CRON is set like so(in web interface):
* * * *... (4 Replies)
Hi all,
I have a script that can be run via cron or via the command line.
Is there any way that I can place something on the script to be able to distinguish/differentiate whether the script was run via a user in the command line or whether it was run from the cron? (3 Replies)
In my cron thare is a line like
24 11 * * * /usr/batch/bin/abc.sh > /usr/batch/log/abc.log 2>&1
along with other entries. I want to comment out this line through a shell script. My local variable 'line'ontains the full entry (i.e. 24 11 * * * /usr/batch/bin/abc.sh > /usr/batch/log/abc.log... (4 Replies)
Hi, I have a script that seems to run to completion when in the command-line, but when it is run using the cron, it seems to time out.
They both start and run fine, but on the CRON it stops prematurely.
The script hits an API every few seconds and grabs data.
Does anyone have any idea on... (4 Replies)
Hi
I have a text file (Input.txt) with two column entries separated by tab as given below:
aaa str1
bbb str2
cccccc str3
dddd str4
eee str3
ssss str2
sdf str3
hhh str1
fff str2
ccc str3
.....
.....
..... (1 Reply)
0
I have a script(main.sh) which calls another script(Get_Files.sh) and gets a value in a variable like the below:
File_to_Refresh="$(sh /Aug/work/Get_Files.sh /Aug/Work/Universal_File.txt)"
Now I have to schedule the script main.sh for 3 different files i.e. the Universal_File.txt with 3... (2 Replies)
Discussion started by: bhartiya007
2 Replies
LEARN ABOUT CENTOS
yum-cron
yum-cron(8)yum-cron(8)NAME
yum-cron - an interface to convieniently call yum from cron
SYNOPSIS
yum-cron [config-file]
DESCRIPTION
yum-cron is an alternate interface to yum that is optimised to be convenient to call from cron. It provides methods to keep repository
metadata up to date, and to check for, download, and apply updates. Rather than accepting many different command line arguments, the dif-
ferent functions of yum-cron can be accessed through config files.
config-file is used to optionally specify the path to the configuration file to use. If it is not given, the default configuration file
will be used. It is useful to be able to specify different configuration files for different use cases. For example, one configuration
file might be set to update the repository metadata, and a line could be added to the crontab to run yum-cron frequently using this file.
Then, another configuration file might be set to install updates, and yum-cron could be run from cron using this file just once each day.
FILES
/etc/yum/yum-cron.conf
/etc/yum/yum-cron-hourly.conf
SEE ALSO
yum (8)
AUTHORS
See the Authors file included with this program.
BUGS
There of course aren't any bugs, but if you find any, you should email
the mailing list, yum@lists.baseurl.org, or consult bugzilla.
Nick Jacekyum-cron(8)