Sponsored Content
Top Forums Shell Programming and Scripting Who -u gives different output if run from cron than if run from terminal? Post 302741485 by latimer on Sunday 9th of December 2012 02:41:11 AM
Old 12-09-2012
Jim, thanks for pointing me to the right direction.
Indeed locale is set differently for cron compared to my shell environment.
I altered my script so that it runs
Code:
LC_TIME=en_US.UTF-8 who -u

instead of a plain who -u and now the output is well defined.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to run a process after closing the terminal

i want to execute a shell script even if the terminal is closed. how to do? (3 Replies)
Discussion started by: lakshmananindia
3 Replies

2. Linux

run script through terminal

for all friends i am using linux enterprise 4. i installed oracle 10g in user name oracle.at the end of install i got a pop up window saying that u should run the following scripts(root.sh,orainstRoot.sh) in terminal from root account(cui) without log out oracle account . how i can run these... (5 Replies)
Discussion started by: sadiquep
5 Replies

3. Shell Programming and Scripting

how to run a script using cron job and send the output as attachment via e-mail using unix

how to run a script using cron job and send the output as attachment via e-mail using unix. please help me. how my cron job entry should be? As of now my cron job entry is to run the script at specific time, 15 03 * * * /path/sample.sh | mail -s "Logs" email_id In the above entry, what... (8 Replies)
Discussion started by: vidhyaS
8 Replies

4. UNIX for Dummies Questions & Answers

Script to run a command in a new terminal

Hey, I am trying to write a script that will open all of my session windows, and then secure shell into the appropriate server in the new windows. Seems simple, but I cant get it to work! Please help! :confused: (1 Reply)
Discussion started by: sojo1024
1 Replies

5. Shell Programming and Scripting

Wrong output when run via Cron

Hello, This may be a simple one, but i can't see what the issue is. When i run the script via CLI, then i get the correct output via the if statement, but when i run via CRON i get the wrong statement. echo " Checking Job Status" >> $DIR/Bpimagecleanup_$DATE... (3 Replies)
Discussion started by: Junes
3 Replies

6. Shell Programming and Scripting

Output differs when run manually and when cron job executes it

I get a different output when i manually run the .sh script and when it is run by a cron job. Please help me .. TMP1="/lhome/bbuser/script/wslog/sar.t1" TMP2="/lhome/bbuser/script/wslog/sar.t2" TMP3="/lhome/bbuser/script/wslog/sar.t3" OUTPUT="/lhome/bbuser/script/wslog/sar.out"... (8 Replies)
Discussion started by: nithinankam
8 Replies

7. UNIX for Advanced & Expert Users

Script run by cron gives no output

Hi All, I have a script which checks the status of HP Smart Array & then emails me the output. The script run fine when executed manually but I receive no output when configured in a cron job. The script is below: hpacucli ctrl slot=3 show config | mail -s "ARRAY STATUS-`date`"... (6 Replies)
Discussion started by: coolatt
6 Replies

8. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

9. Shell Programming and Scripting

Run script in new terminal

Hi Guys, I have a script that runs certain simulations in batch mode. I need to schedule some simulations to run over night. For each simulation to complete it should be run in separate terminal. My script is as follows sh run_test.sh <arg1> <arg2> <arg3> ... I need to launch this... (5 Replies)
Discussion started by: aelhosiny
5 Replies

10. UNIX for Beginners Questions & Answers

When I run the code yesterday I am getting output,when I run same code today I am getting error?

If run the below code today its creating all directory and getting output files,I f run same code tomorrow I am getting error. can any one give suggestion to sortout this error. OSError: no such file or directory : '062518'My code looks like this import paramiko import sys import os ... (8 Replies)
Discussion started by: haribabu2229
8 Replies
ypxfr(8yp)																ypxfr(8yp)

Name
       ypxfr - transfer a yellow pages (YP) map from a YP server to the local host.

Syntax
       ypxfr [ -f ] [ -h host ] [ -d domain ] [ -c ] [ -C tid prog ipadd port ] mapname

Description
       The  command moves a YP map, specified by the mapname argument, to the local host by making use of normal YP services.  It creates a tempo-
       rary map in the directory (which must already exist), fills it by enumerating the map's entries, obtains the  map  parameters  (master  and
       order  number) and loads them into the map.  Once has accomplished these tasks, it deletes any old versions of the map and moves the tempo-
       rary map to the real mapname.

       If is run interactively, it writes its output to the terminal.  However, if it is invoked without a controlling terminal, and  if  the  log
       file exists, it will append all its output to that file.  Since is most often run from or by the log file can be used to retain a record of
       what was attempted, and the results.

       For consistency between servers, should be run periodically for every map in the YP database.  Different maps change  at  different  rates:
       the  map  may  not  change for months at a time, for instance, and may therefore be checked only once a day. It is possible that or changes
       several times per day.  In such a case, it is appropriate to check hourly for updates.	A entry should be used to perform periodic updates
       automatically on YP server machines only.  Rather than having a separate entry for each map, commands can be grouped to update several maps
       in a shell script.  Examples (mnemonically named) are in and They can serve as reasonable first cuts.

       See and for an overview of the yellow pages.

Options
       -f	 Force the transfer to occur even if the version at the MASTER is not more recent than the local version.

       -c	 Do not send a "Clear current map" request to the local process.  This flag should be used if is not running locally at  the  time
		 when is running.  Otherwise, will report that it can not talk to the local and the transfer will fail.

       -h host	 Get  the map from host, regardless of which map is the master.  If host is not specified, will ask the YP service for the name of
		 the master, and try to get the map from there.  The host option can be a name or an internet address in the form a.b.c.d .

       -d domain Specify a domain other than the default domain.

       -C tid prog ipadd port
		 This option is only for use by When invokes it specifies that should call back a process at the host with IP address ipaddr, reg-
		 istered as program number prog, listening on port port, and waiting for a response to transaction tid.

Files
See Also
       ypfiles(5yp), cron(8), yppush(8yp), ypserv(8yp), ypsetup(8yp)

																	ypxfr(8yp)
All times are GMT -4. The time now is 12:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy