12-03-2016 12:48 PM
I have a thought to check if the folder is updated or not , I mean like consider that there is a folder where we have the datasets and in this folder the datasets are regularly updated. Now is there a way we could check if the folder is updated even if a single dataset is updated and we get to know that its updated.
what i was thinking is we could set up a cron job for the same which runs regularly and sends an email to user when the folder is updated. However i am unable to understand how could I compare the old dates with updated datasets dates. I was think to compare the modified dates but how could I make the old dates stored in a memory so that I could check the modified dates.
could you please let me know your thoughts or suggestions on the same. So I could program.
12-03-2016 02:14 PM
It could be as simple as storing the last modified date in a master table somewhere. A SAS dataset or a text file in the folder are options to store the date. Then the job can compare to that date.
12-03-2016 08:14 PM - edited 12-03-2016 08:19 PM
And just as an addendum to what Reeza wrote: And you would of course have to store this control table containing the last modified folder date in a different folder as else any update to the control table would change the modified date of the folder you check.
If this is about running some process when something in your directory changes, then - depending on your Unix system or scheduler available - there might also be options where you can have a trigger on files and/or folders where the process gets executed "on change". http://superuser.com/questions/363511/execute-script-program-when-file-changes
You will have to investigate what's available for your specific environment.
12-03-2016 10:39 PM
filename x '/folders/myfolders/sas/'; filename y '/folders/myfolders/sas/text.txt'; proc sql; create table want as select * from dictionary.extfiles; quit;