We help IT Professionals succeed at work.

Unix OS

33K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.

Hi Experts

I have a scenario where in the there are 2 receivers to which the file from source directory needs to be sent and the receiver is determined based on the timestamp on the file or more precisely depending on the day, and the same filename scehma is used in source to send to both the receivers.  

   FYI, The middleware I am using provides a file adapter which has options to include direcotry paths, include shell scripts to run before and after the file processing. I can use this File adapters and both sender and receiver sides. All I need is to finalize a logic for this approach and implement it in iSeries shell script.

   For example if the source file in /src directory is FileName12022014 this needs to be sent to Receiver1 /rec1 directory only ----and in the same way all the files which are placed untill the 6th day in this case FileName12072014 should also be placed only in receiver1 directory /rec1. But the FileName12082014 which is the 7th day file should be sent to both the Receiver 1 and Receiver 2. I see we wont be able to achieve this without the shell script in the file adapter, but would appreciate suggestions on the best way to achieve this.
 
Regards
Kalyan
0
Hi,

I have a netapp storage which was initially created for Replication into our DR Site. Now We created a new Data center and new hosts are added into that DC. I want the same storage to mount on the new hosts. I checked on my Netapp Manager but no LUNS are showing with that name, only volume is created. I don't want to create a new LUN but share the same Datastore.
Any Suggestion!
0
I'm trying to understand this line. I can only undertand that lock file is removing, but I am not sure what exactly this entire line is doing.  Can anyone explain ?


trap 'echo " Removing the lock "; rm -f ${lock_file} 2> /dev/null ; exit 0' HUP INT QUIT TERM STOP
0
Hi Experts,
I've this Linux machine:
Linux version 2.6.18-371.3.1.el5xen (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54))

I run df command:

[ora11g@hy]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/vg_ora
                             9.7G  6.8G  2.5G  74%       /u01
/dev/lv_ora
                              59G   47G  8.2G  86%      /sxr/oracle
                                
      
I'd like to know Why the total size 9.7G isn't the same as Used+Available 6.8G + 2.5G (9.3G) and total 59G isn't the same as 47G + 8.2G (55.2)?

Thanks in advance!
0
Hi,
 Running the following script in TOAD for Oracle produces results as expected.
truncate table tabc_gtt_task_volumes_tst;

truncate table tabc_gtt_volume_calc_tst;

truncate table Tabc_GTT_OPENING_TST;

COMMIT;

DECLARE 
  P_DEPARTMENT VARCHAR2(32767);
--  P_USERS VARCHAR2(32767);
--  P_TASKS VARCHAR2(32767);
  P_DATE_FROM DATE;
  P_DATE_TO DATE;
  P_ORDER_BY VARCHAR2(32767);
  P_ORDER_DIRECTION VARCHAR2(32767);
  O_RESULTS TESTAPP.PK_TEST_REPORTS.CURSOR_TYPE;

BEGIN 
  P_DEPARTMENT := 50;
  P_DATE_FROM := to_date(SYSDATE-6);
  P_DATE_TO := to_date(SYSDATE-1);
  P_ORDER_BY := 1;
  P_ORDER_DIRECTION := 'ASC';
  -- O_RESULTS := NULL;  Modify the code to initialize this parameter

  TESTAPP.PK_TEST_REPORTS.TASK_VOLUMES_tst ( P_DEPARTMENT, 
  --NULL, NULL, 
  P_DATE_FROM, P_DATE_TO, P_ORDER_BY, P_ORDER_DIRECTION, O_RESULTS );
  COMMIT; 
END;


set termout off
set pagesize 0
set linesize 10000
set feedback off
set timing off
set verify off
set trimspool on
set wrap off

--SPOOL /out/abc/daily_reports/Test_Tasks.csv;


select  'Volume_Day'      ||  '|' || 
        'User'            ||  '|' || 
        'Task'            ||  '|' ||
        'Completed_Tasks' ||  '|' ||
        'Within_SLA'      ||  '|' ||
        'Outside_SLA'     ||  '|' ||
        'Received_Tasks'           
from dual;
select a.volume_day               ||  '|' ||
--       a.the_user, 
       c.name                     ||  '|' || 
--       a.the_task, 
       b.name                     ||  '|' || 
       

Open in new window

0
My organization has a Unix Domain which runs an LDAP for authentication.  We also have a couple of tools that run on Windows platforms only.  Currently one of those tools is going through an update and the customer is looking to fully integrate this box into the network to include authentication.  Any suggestions would be welcome as to how to do this.

Tech details.

Windows Server 2008r2 Standard server.  Not running AD - the customer does not want AD at this time.  Most of the backbone network is run on Solaris machines serving data to Mac clients.  Users authenticate through the LDAP which includes all attributes of their positions and responsibilities.  I.E. the admins have an Admin flag on their accounts.  Limited use  of groups etc.
0
HI,

Where is  AIX system log file located?  We had cluster system and someone executed vgonline on other node. I would like to see how can I verify when it was executed?  Which log file can provide such an information?
0
I have below setting for my PS1.


export PS1="\e[1;33m\u: \w $ \e[m"


I would like to increase PS1 values - to increase font.
please advice how to custmise for the same
0
we would like to configure our Linux servers in such that, if we accidentally  delete any files, those files  automatically move to some preconfigured directory.

example :  $ rm -rf file.txt

$ls -ltr   /recyclebin
output : file.txt

--
please advice the steps to customize the rm -rf command
0
Hi,

I have a quick question regarding hacmp cluster sysetm on AIX.  We have installed VCS on AIX and it does varyoff the VG on node1 and varyon the VG on node2 and mount the file system, when we do fail over.  How does it work on HACMP ?
Does  it export the VG and import into node2 or use the same method as VCS ?
0
when I tried to login I am getting below error message.
login with PUTTY and other terminal have no issues.

I prefer to use mobaxterm, please advice
--------- ----------


If you changed or re-install this server recently, and if you are really sure
that no other computer is using its IP address, then you can reset this alarm
by deleting the ~/.ssh/known_hosts in a new MobaXterm local terminal.
Add correct host key in /home/mobaxterm/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/mobaxterm/.ssh/known_hosts:10
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
--------------
0
Hi,
I have file on Linux with 50000+ lines like below:
Wed Nov 19 04:42:33 2014|1969929|877973|439.549|
Wed Nov 19 04:43:05 2014|1291231|969149|138.522|
Wed Nov 19 04:43:05 2014|969151|969149|5.884|

I need to do the following on Linux:
    First column convert to format "%Y%m%d%H%M%S"
    Second and third column divide by 1048576
    Forth column roundup

20141119044233|1.87|0.84|439


Thanks in advance
0
We have a sun Netra v210 (not a sunfire v210) after replacing the motherboard on power on I keep getting a "Sc Alert: SCC has been removed"  I can't log into the SC even though I believe I know the password and have tried to reset it. After the Serial console times out and I should drop to the OK prompt, the system is unresponsive. The power supply lights are fine and the power supply fans come on. There is a wrech status light on the back of the system  comming from the motherboard but no lights apear on the front the system. All the Cables to the SC card reader/Power switch, DVD backplane, SATA backplan, PCI Riser? card seem fine and the other connectos to the motherboard seem to be fine. Changing the front selector knob causes nothing to come up in the console window and the front power button seems to be unresponsive even when the system is in the I position.  We are usign the original SC card for the systems and it is properly and fully inserted such that a zip tie could be put through the hole in the SC card holder to hold the card in place. We have tried removing the SC card and booting the system and we have also tried removing power, the SC card and the motherboard battery and then re-inseting them.   Does anyone know what is wrong. (Note that the alom reset instructions that say use the letter e to reset the Alom password don't work on this systems as the e option in the alom escape menu is for setting the external and internal console serial port baud rate.  Not …
0
Oracle SPARC VM on T4-1 server.

On the above I have 4 SPARC VMs running, I want the VM build1 to have 8 VCPUs instead of the current 2, so I do "ldm set-vcpu 8 build1" and it initially sets (I'm using Dynamic Configuration), as ldm list reports this, but when I run "ldm list" again over the following seconds it gradually takes each VCPU I added away again and I end back with 2.

The policy looks fine and is the same for all the other VMs
ldm add-policy util-lower=25 util-upper=75 vcpu-min=2 vcpu-max=32 attack=1 decay=2 priority=1 name=build1 build1

Open in new window


So I think I must be doing something wrong,  but maybe it just hasn't reached the policy freshhold yet, but that can't be right as I see quite often build2 running at 1-5% and it still has 8 VCPUs, and build1 (the one I want 8 VCPUs) I see running at 50-60% still stuck with its 2 VCPUs - what is going on?

After setting "8" VCPU
root@pinbg:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4608M    0.8%  149d 14h 
build1     	 active     -n----  5004    8     24G      0.3%  11d 16h 32m
buildconsole     active     -n----  5003    4     4G       0.1%  11d 22h 56m
build2        	 active     -n----  5000    8     24G      1.3%  149d 11h 
build3           active     -n----  5001    8     24G      0.9%  149d 11h 

Open in new window

0
Trying to boot sunfire solaris box moved to another datacenter.
Got this error panic
0
Hello,
I am getting the following error while trying to executing the java -version command :
libjvm.so preloadLibrary(/usr/openv/java/sdk/jre/lib/ppc64/compressedrefs/libj9vm27.so): Symbol resolution failed for /usr/openv/java/sdk/jre/lib/ppc64/compressedrefs/libj9prt27.so because:
        Symbol getsystemcfg (number 162) is not exported from dependent
          module /usr/lib/libc.a[shr_64.o].
Could not load module /usr/openv/java/sdk/jre/lib/ppc64/compressedrefs/libj9vm27.so.
System error: Exec format error
Examine .loader section symbols with the 'dump -Tv' command.
libjvm.so failed to load: j9vm27

The oslevel command give this :
<user>-/usr/java71_64/jre/bin> oslevel -s
6100-03-01-0921

All libraries seem to be present.
Can you help to resolve the problem ?

Thanks
0
Hi Experts,

If I run this Bash script:
#!/bin/bash

echo "Unsorted:"
cat sort_test11
od -bc sort_test11
LC_ALL=""
echo "LC_All=$LC_ALL"
/bin/sort sort_test11
LC_ALL=C
echo "LC_All=$LC_ALL"
/bin/sort sort_test11
LC_ALL=en_US.utf8
echo "LC_All=$LC_ALL"
/bin/sort sort_test11

Open in new window


From the command line I get this output:

Unsorted
z
a
_
A
Z
0000000 172 012 141 012 137 012 101 012 132 012
          z  \n   a  \n   _  \n   A  \n   Z  \n
0000012
LC_ALL=
A
Z
_
a
z
LC_ALL=C
A
Z
_
a
z
LC_ALL=en_US.utf8
_
a
A
z
Z

But from cron I get this output:

Unsorted
z
a
_
A
Z
0000000 172 012 141 012 137 012 101 012 132 012
          z  \n   a  \n   _  \n   A  \n   Z  \n
0000012
LC_ALL=
_
a
A
z
Z
LC_ALL=C
_
a
A
z
Z
LC_ALL=en_US.utf8
_
a
A
z
Z

As you can see, the differences between command line and cron sort output occur when LC_ALL contains nothing or 'C'.  All cron job sorting seems to be case insensitive, but the only case insensitive output from the command line run occurs when LC_ALL=en_US.utf8.

Questions:
Q1. Why these differences between sorting when running the same script from cron and the command line?

Q2. How should I get case sensitive sorting from the cron job?

I haven't found anything useful in "man sort" on this platform yet.  Nor Google.

Here's the version of sort:
$ /bin/sort --version
sort (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.

And the version of CentOS:
0
Need to run sql scripts via unix/linux, against corresonding databases, basically updating some columns in different databases/schema & tables too, have all the update scripts ready, but rightnow they are all individual scripts, need to merge them all together as one shell script, in order for them to be executed as sys and globally too, basically just after the refresh job completed, they'll execute this one global scripts, which'll update all the columns in the corresponding databases/schemas & tables too.

Can any one please assist/advise/guide in writing this unix shell script, here is the req:

- should be only one script for all the databases/environments
- must be executed as sys, because can't code the password, will be kicked off by the job schedular, just after the refresh job finished.
- not all the columns are same in all the dbs, means the script need to check the databases running on this box/server and then only execute the script corresponding to that database/schema & tables only.

Also is there any way to commit in between too, because just executed one script and there is big spike on the db, means would like to commit too, in between, after some thousands of updates.

Can any one please assit/guide here ... thanks in advance.
0
Hello

I've got a directory with a literally 100k+ of  zipped files. Each zip contains two files.

I want my script take 4 arguments, the first two being the vaules to search for, 3rd being a limit (numer of files to match) the 4th *optional* being a list of files to ignore (we have already matched these files - don't want them again).

I want the scipt to interate over all files in a given directory, unzip to memory, grep for 1st and opitionally 2nd argument - files that are matched up to the max-limit (say 20 files) are copied to another directory. A result file is output that shows which zip files have matched. I would also like the result file to be used as an input argument for files to ignore.

My scripting is pretty poor.  I figure I need to use UNIX 'find . -name *.zip', then 'zipgrep'

Any help would really really be appreciated...

Thanks in advance.

M
0
I'm on Solaris x86  10 & 11.

Q1:
What's the right way to disable tcp_timestamp?

http://www.cns.nyu.edu/~fan/sun-docs/sol10-01-13/html/E37386/chapter4-31.html
Above link does not have any parameters for tcp_timestamps (guess there is an 's' at
the back) & the closest is tcp_tstamp_always

Q2:
At some other URLs, it gave the same method as setting it in RHEL ie
   echo 0 > /proc/sys/net/ipv4/tcp_timestamps     &
add line below to etc/sysctl.conf (create the file if it does not already exist):
   net.ipv4.tcp_timestamps = 0

Q3:
if sysctl.conf does not exist, is that the only line to add in or we ought to
add a few other lines to make the parameters "balanced".  I recall I used
to tweak /etc/system & several parameters need to be inside this system file
0
Anyone know where has  sunmanagers.org gone to & what's it's
closest equivalent if it's not around anymore ?

Is its archive still around?
0
Planning to disable it for security reason but have heard F5 advise against it for F5 .


https://docs.oracle.com/cd/E19455-01/806-6779/6jfmsfr8a/index.html
Url above also has some indication

Q1:
What's "Commitment Level" unstable?


https://www.ietf.org/rfc/rfc1323.txt
Url above also indicates something:
...working with TCP's that do not implement the extensions.  The timestamps are used for 2 distinct mechanisms:
   RTTM (Round Trip Time Measurement) and PAWS (Protect Against Wrapped Sequences).

Q2:
Does any Web applications & Solaris 10 x86 VMs need/use RTTM & PAWS ?

Q3:
Can I safely say that disabling Tcp_timestamps is only a concern on congested networks
esp WAN but on Gigabit LAN, its performance impact is negligible?
0
Try to share a zfs filesystem and cannot seem to get the syntax correct, and it looks like it should work.

Trying to share
aeneas-prdtax1.pool/u01           31K  4.00T    31K  /u01

Open in new window


Managed to set sharenfs to on

bash-3.2# zfs get all u01.pool/u01 |grep -i sharenfs u01.pool/u01  sharenfs              on                     local

Open in new window


But now I want to set some share properties, such rw=* etc

zfs set share=name=u01,path=/u01.pool/u01,prot=nfs,anon=0,sec=sys,rw=* u01.pool/u01

Open in new window


But is fails

cannot set property for 'u01.pool/u01': invalid property 'share'

Open in new window


The syntax looks correct, as per Oracle docs, what am I missing?
0
I was asked to pass the days parameter in crontab so the number of days can vary.
0
I would like to set bash prompt for my dev server and prod server.

for dev server I would like to be yellow+bold+ bright.

I tried my best and partly achieved using below settings.
--------- -----------
PS1="\e[1;33m\u : \w> $ \e[m"
------------------------- -------
but I need this color to be more Bright + Yellow.
for your more understanding my required color , please refer the attached file, where few info messages at the top, are displayed in yello+bold+ bright. I wanted that be same for my prompt.

so please advice for
1) how to set PS1 value , yello+BOLD+ bright, shown in the screenshot
2) how to set PS1 value   Red + BOLD + bright,
3)  how to set permanent settings

please advice for the above queries
 
waiting for your reply
C--Users-agori-Desktop-22.png
0

Unix OS

33K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.