01-02-2009
When cron runs any job, it does so in a minimal environment, but when you run a job manually, your whole environment is usually setup with .profile (Korn, Bourne and Bash, I believe) or .login/.cshrc (CSH).
In cron, you can add an entry such as...
00 12 * * * . /home/.profile; <command>
so that you get the whole normal profile available to the cronned command.
Jerry
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,
Is it possible to make SOAP calls from within Unix shell scripts?
I need to access a web service from within UNIX in order to lookup something while I am doing some parsing on a file.
Regards,
Laud (2 Replies)
Discussion started by: Laud12345
2 Replies
2. Shell Programming and Scripting
Here is what I have:
#!/bin/bash
# Setup year date and month
YR=`date +%Y '{print $6}'`
MON=`date +%b '{print $2}'`
DAY=`date +%d '{print $3}'`
file=$YR$MOY$DOM
# clear
# Dump database using USER/PASS to ..sql
mysqldump --user=me -ppass database > database-db.$file.sql
The YR, MON and... (2 Replies)
Discussion started by: npereira
2 Replies
3. Shell Programming and Scripting
hello experts
cany any one help me i want to make one script which can rlogin to another machine .
but it should not ask me username/password from me of another machine it should take the username and password from the script only.
please help me out.
regards,
shary (2 Replies)
Discussion started by: shary
2 Replies
4. Shell Programming and Scripting
Dear all
Dear Brother
I am bit new to programming or shell scripting. I have given one shell script which is regarding combining all the 240 or less files in a particular folderwhich is related to one hour of the day. There will be 24 these kind of folders related to a day . It means there... (4 Replies)
Discussion started by: girish.batra
4 Replies
5. Shell Programming and Scripting
Hi,
i have written a shell script and its working fine till now. Now, i have to enhance it with a small updation.
i need to make a file inside my file that will contain the below parameters
1) Customer_id
2) Server_id
3) No. Account
All the above variables are already been taken in... (3 Replies)
Discussion started by: dazdseg
3 Replies
6. Shell Programming and Scripting
Hi all
I need help for the issue below.
I need to create script:
FORM_cmd=query || import
FORM_command=add
FORM_msisdn=389881234567
FORM_provcode=SK
FORM_attr=12
FORM_cmd can be "query" or "import"
when FORM_cmd="query" then execute -> spdci -cmd $FORM_cmd FORM_cmd
when... (3 Replies)
Discussion started by: vasil
3 Replies
7. Shell Programming and Scripting
I run a small instrument lab. We track our user's time on the instruments with a very manual process of 'last wtmp.1' then cut/paste data into spreadsheets. My boss makes the initial spreadsheets then I convert and format them for uploading into our billing software (COReS). Cores is looking for a... (8 Replies)
Discussion started by: jpontius
8 Replies
8. Shell Programming and Scripting
I have a situation where I have a list of airplanes that make a series of flights.
Therefore I am looking up the different flights that each airplane makes based on a postgres sql query:
select flightid from plane where airplane='DELTAx'
As a result I get a series of flight numbers... (0 Replies)
Discussion started by: JSNY
0 Replies
9. Shell Programming and Scripting
Hello, im a new user on this site and learning scripting very slowly at a understanding pace. However i am up with a challenge and require help completing this.
The script has to include arguments, variables, decisions and loops. So the script is about calculating the broadcast address for any... (5 Replies)
Discussion started by: tHe666
5 Replies
10. UNIX for Beginners Questions & Answers
This script is executed whenever a new vehicle is added to the cycle-motor park
of campus. The script asks for the following information about the car and adds a new
line to the vehicle file.txt: name (name of an animal, unique identifier), color, mark,
model, type (e.g., electrical, manual),... (2 Replies)
Discussion started by: andre2222
2 Replies
cron(8) System Manager's Manual cron(8)
NAME
cron - The system clock daemon
SYNOPSIS
/usr/sbin/cron
DESCRIPTION
The cron daemon runs shell commands at specified dates and times. Commands that are to run according to a regular or periodic schedule are
found within the crontab files. Commands that are to run once only are found within the at files. You submit crontab and at file entries
by using the crontab and at commands. Because the cron process exits only when killed or when the system stops, only one cron daemon
should exist on the system at any given time. Normally, you start the cron daemon from within a run command file.
During process initialization and when cron detects a change, it examines the crontab and at files. This strategy reduces the overhead of
checking for new or changed files at regularly scheduled intervals. The cron command creates a log of its activities. The cron daemon
must be started from the system startup scripts because it must begin execution without a login user ID set. The cron daemon starts each
job with the following process attributes stored with the job by the invoking process: Login user ID Effective and real user IDs Effective
and real group IDs Supplementary groups
It also establishes the following attributes from the authentication profile of the account associated with the login user ID of the invok-
ing process: Audit control and disposition masks Kernel authorizations
DIAGNOSTICS
The at and batch programs will refuse to accept jobs submitted from processes whose login user ID is different from the real user ID.
FILES
Specifies the command path. Main cron directory Directory containing the crontab files. List of allowed users. List of denied users His-
tory information for cron Queue description file for at, batch, and cron
RELATED INFORMATION
Commands: at(1), crontab(1), rc0(8), rc2(8), rc3(8)
Files: queuedefs(4) delim off
cron(8)