03-03-2008
scan direcotries
Hi
I am new to this forum, and glad to be a part of it here after. I have an intersting issue for which I need suggestions of you great minds.
I am in process a building a shell script which should scan a directory for a specified amount of time and prepare a list of all the files that were created in that time.
lets say at the fist scan of 100 sec, there were three files created in $HOME/mydir/
it should prepare a file with this list: some thing like below.
test1.dat
test2.dat
test3.dat
At the second run of the script, lets say 5 more files are created then it should update the previous file list with these latest 5 files (excluding the last three): some thing like below.
test4.dat
test5.dat
test6.dat
test7.dat
test8.dat
File naming conventions can be any thing, but the extension of all the files would be the same.
Any Ideas let me know: email id removed
Thanks
Nag
Last edited by vino; 03-03-2008 at 02:44 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi.
how to search a range of IP:s for their registed IP names?
Like nslookup or host for all IPs 130.xxx.xxx.1 to 130.xxx.xxx.254
//nicke (2 Replies)
Discussion started by: nicke30
2 Replies
2. UNIX for Dummies Questions & Answers
I need a command that I can run to diff two directories.
I only want it to show the directories that are different - not the files beneath the directories.
In other words, I have 2 directories: dir1 and dir2.
dir1 has the following subdirectories: sub1, sub2, sub3, sub4.
dir2 has the... (1 Reply)
Discussion started by: eshman
1 Replies
3. UNIX for Advanced & Expert Users
Can any one please let me know below ones
1) How to Perform the Port Scan in Solaris Environment and how to block the unwanted Ports.
2) How to know whether particular Port is listning the requests or not?
Thanks
Ramkumar.B (7 Replies)
Discussion started by: myramkumar
7 Replies
4. Shell Programming and Scripting
Hi,
I am new to unix.
I have a file with records like the below
ads-sap-4.txt: </a></b></span><span class="linkbutton yellow_but"><a id="2005754_more" style="cursor:pointer; cursor:hand;"... (3 Replies)
Discussion started by: akondeti
3 Replies
5. UNIX for Dummies Questions & Answers
i have a script to look for a file, but it moves a file that's being used.
i want to use:
if file exists > 0, and not being updated/used in the last 2 minutes, move to /tmp
i can do this much:
if
then
mv filename.txt /tmp
else
exit
fi
or how can i check if... (3 Replies)
Discussion started by: tjmannonline
3 Replies
6. Shell Programming and Scripting
The script should
_scan a specific directory
_If a file name is like one provided, then run the command to send the file via CFT
The name should be picked from a list. The current list is :
... (11 Replies)
Discussion started by: fireit
11 Replies
7. Shell Programming and Scripting
Hello all
I want to help
I have some compressed files on the system
When you want to unzip these files
Delete any file which symlink
"ln -s"
{{
I need script is necessary
Script contain:
Any operation to decompress the system is doing to delete any symlink... (0 Replies)
Discussion started by: x-zer0
0 Replies
8. Red Hat
In Solaris the administrator has to update /kernel/drv/sd.conf file to tell the sd driver to scan for a broader range of scsi devices.
Can someone please tell me what file needs to be update in Redhat Linux 5 for the same.
Second part of the question is WWN for HBA's can be found (atleast in my... (1 Reply)
Discussion started by: Tirmazi
1 Replies
9. UNIX for Dummies Questions & Answers
i want to scan all open and closed ports on a server. how can i do this.
i intend on using nmap, but if there are better ways to do it, please let me know.
i understand there are a total of 6335 allowable ports on a server.
so out of that 6335, i want to know which is open or closed. id... (1 Reply)
Discussion started by: SkySmart
1 Replies
10. Google Chrome OS
How to scan a Chromebook.
I just want to scan a chromebook like other OS and show the device details in our asset management tool.
While googling, we can open command prompt in chromebook as like of linux. I hope it is an unix based OS, so there might be some option to scan the machine as... (2 Replies)
Discussion started by: prasankn
2 Replies
LEARN ABOUT CENTOS
scsi-rescan
RESCAN-SCSI-BUS.SH(1) User Commands RESCAN-SCSI-BUS.SH(1)
NAME
rescan-scsi-bus.sh - script for adding and removing SCSI devices without rebooting
SYNOPSIS
rescan-scsi-bus.sh [options] [host [host ...]]
OPTIONS
-a, --alltargets
scan all targets, not just currently existing [default: disabled]
-d enable debug [default: 0]
-l activates scanning for LUNs 0--7 [default: 0]
-L NUM activates scanning for LUNs 0--NUM [default: 0]
-w, --wide
scan for target device IDs 0--15 [default: 0--7]
-c enables scanning of channels 0 1 [default: 0 / all detected ones]
-r, --remove
enables removing of devices [default: disabled]
-f, --flush
flush failed multipath devices [default: disabled]
-i, --issue-lip
issue a FibreChannel LIP reset [default: disabled]
-u, --update
look for existing disks that have been remapped
-s, --resize
look for resized disks and reload associated multipath devices, if applicable
--forcerescan
rescan existing devices
--forceremove
remove and readd every device (DANGEROUS)
--nooptscan
don't stop looking for LUNs is 0 is not found
--color
use coloured prefixes OLD/NEW/DEL
--hosts=LIST
scan only host(s) in LIST
--channels=LIST
scan only channel(s) in LIST
--ids=LIST
scan only target ID(s) in LIST
--luns=LIST
scan only lun(s) in LIST
--sync, --nosync
issue a sync / no sync [default: sync if remove]
--attachpq3
tell kernel to attach sg to LUN 0 that reports PQ=3
--reportlun2
tell kernel to try REPORT_LUN even on SCSI2 devices
--largelun
tell kernel to support LUNs > 7 even on SCSI2 devs
--sparselun
tell kernel to support sparse LUN numbering
Host numbers may thus be specified either directly on cmd line (deprecated) or or with the --hosts=LIST parameter (recommended).
LIST: A[-B][,C[-D]]... is a comma separated list of single values and ranges (No spaces allowed.)
SEE ALSO
rescan-scsi-bus.sh Homepage: http://www.garloff.de/kurt/linux/#rescan-scsi
sg3_utils Homepage: http://sg.danny.cz/sg
rescan-scsi-bus.sh 1.57 leden 2014 RESCAN-SCSI-BUS.SH(1)