Thursday, June 22, 2017

Find and Exec

mtime,ctime,atime
Option in Find Command ON Linux

mtime - modified content in files
ctime - mofified Permision, Group, Owner
atime - Time to access files

exp:

find /u03/rman-backup/ \  <----- path to finding
-name "*NIDAREG*" \    <------- find word in FileName
-mtime -1 \        <------- Modified Time ( in this case , time to Create file on last day (-1))
-exec scp -p {} admin@192.168.1.10:/STORAGE/rman-backup/NIDAREG \; <----- execute Command ( Copy file to another File Server via SCP command )

*scp option -p (preserve timestamp)

find ./*.gz \    <----- find *.gz
-mtime +7 \    <---- time over 7 day
-type f | \         <------ type File
xargs du -ksh    <-----find Size of File


STAT Command
- show atime,ctime, mtime

exp:

stat filename

[admin@M4000-Storage temp]$ stat BACKUP_NIDAREG_20170622.out
  File: ‘BACKUP_NIDAREG_20170622.out’
  Size: 33134           Blocks: 72         IO Block: 4096   regular file
Device: 810h/2064d      Inode: 112541699   Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1001/   admin)   Gid: ( 1001/   admin)
Context: unconfined_u:object_r:unlabeled_t:s0
Access: 2017-06-22 10:05:53.000000000 +0700
Modify: 2017-06-22 01:12:06.000000000 +0700
Change: 2017-06-22 10:15:57.289435709 +0700
 Birth: -


ref: http://www.unix.com/tips-and-tutorials/20526-mtime-ctime-atime.html

ADD SCSI Disk Oracle Linux

:find scsi controller

ls /sys/class/scsi_host/
host0 host1 host2

:scan scsi disk

echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout