Hi,
I have a Unix directory where I get number of files . out of them I need to get the names of files which are modified in current month I.e. today-30 days and that should exclude the files which are currently in use.
I am absolutely running out of ideas as I have less/bill experience on unix .
Any help is really really appreciated
lsof lslk are OS commands that are doing a list of files that the OS sees as open/locked. (Xcmd needed)
15 Linux lsof Command Examples (Identify Open Files) Finding and removing locked files on a GNU/Linux system | unix-heaven.org It is requiring to understand what is happening
1/ How are seeing that they are modified by the files date-stamp or by some checksum method.
2/ files being in use. That is more difficult one by its definition.
technically it is about locks SAS(R) 9.3 Companion for UNIX Environments but locking is not mandatory so you can miss those
logically it is about knowing who is using that data. In that case you should have some monitoring tool that answers that question. But as with locking you can miss that info.
What is available and what is the requirement?
There are a number of external file functions that will let you get the names of files in a directory and then get properties such as modified date. Look for: Dopen , Dread, Dsname, Open, Foptname, Foptnum, and Finfo functions.
It is OS command thing.
I would use OS command to get these result and redirect it into another file , after that using sas code to get what I want.
or use Filename statement + PIPE .
lsof lslk are OS commands that are doing a list of files that the OS sees as open/locked. (Xcmd needed)
15 Linux lsof Command Examples (Identify Open Files) Finding and removing locked files on a GNU/Linux system | unix-heaven.org It is requiring to understand what is happening
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.