Hello,
I am fairly new to Linux and want to learn more and more about shell scripting and Linux in general.
I would like to create a shell script that will wait for another shell script that I created to finish before running.
]# ps -ax | grep .backupscript.sh
21091 pts/0 S+ 0:00 /bin/sh /bin/.backupscript.sh
The first script is basically moving files to another server so I was thinking I could write a script that would grep for the name of the shellscript and then wait until it is no longer found.
For example if I do a ps -ax while the script is running, I see "/bin/sh /bin.backupscript.sh ", which is the first script that I created.
When the script is no longer running the grep ps -ax would not get any hits which would tell me its safe to run my second script.
If you can think of another way to do this, I am open for any suggestions.
Thanks in advance,
Matt