Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

which files are getting changed during the run process

I am running a process and that process updates more than 50 files.
I like to know what are the files got changed during this process.
The process is a shell script. I just like to know the file names and the full location of these files. I know the root directory which is
/app/psoft/psoft92

the script location is /app/psoft/scripts

The requirement is as follows:-
I copied the scripts directory from one server to the new server and it is not working on the new server. I will run this on the old server and find if all the directories exists on the new server.
0
Oranew
Asked:
Oranew
  • 6
  • 4
1 Solution
 
simon3270Commented:
Before you start the process,

    touch /tmp/markstart

then run the process and afterwards get a list of files changed since the"touch" with

    find /app/psoft/psoft92 -newer /tmp/markstart

(edit to correct path after "find" command - copied the wrong text from your question - I can't get the hang of EE on mobile devices!)
0
 
OranewAuthor Commented:
This does not work
0
 
simon3270Commented:
In whatway?  No output?  Too much output?

Were any files updated on the server you tested on?  If you know at least one file which definitely *is* changed, do an "ls -l" on it before running the script, and then again afterwards.  Has the date and time changed?  If not, we'll have to think of another way.

If the problem is just that directories don't exist on the 2nd server. you can justcreate the same directory structure as is on the first machine.  Go to the first machine and:
    cd /app/psoft/psoft92
    find . -type d > /tmp/psoftdirs

Then copy /tmp/psoftdirs to /tmp on the second machine, and on that second machine
    cd /app/psoft/psoft92
    cat /tmp/psoftdirs | xargs mkdir -p
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
simon3270Commented:
One other thing - the "-newer" test will only report files which are changed, it won't report files which the script reads (such as configuration files).  You *may* be able to find these by checking the "last access time" rather than the "last modification time", but that is not always reliable (it depends whether checking a files's access time is counted as an "access").  The other way is to run "strace" on the script - that reports all system calls that the scipt makes, including file access - it will probbaly be an enourmous file, but it should be possible to extract a list of unique file names.
0
 
OranewAuthor Commented:
The solution did not give any output but errors on find.
As no one else answered this question and I don't have the right answer I will request to go ahead and close it.

This solution is not working for me but it may have worked for the expert
0
 
simon3270Commented:
What errors? If, for example, your "find" doesn't support "-newer", we'll have to think again.

As you may have seen in some of my other answers, I hate to give up!
0
 
OranewAuthor Commented:
This solution did not worked
0
 
simon3270Commented:
OK, if all we are going to get is "it didn't work", I have no objection to the close.
0
 
OranewAuthor Commented:
No solution worked
0
 
simon3270Commented:
I see from other questions that you are using Solaris. This may be why my commands did not work. If you had either mentioned this, or said what had actually failed, we might have got further.

I would normally suggest that you deleted the question rather than accept your own answer (particularly since your "answer" is nothing of the sort), but my answers are perfectly good for Linux, so might help others.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now