Recursive Shell script

I'm trying to run the script below recursively but it is generating multiple and simultaneous processes. how do I do to start same script again (last line of my script) only after he had just run entirely?

The file name is bachup.sh

I am using this command:

# / bin / bash /
 rsync-avzu - delete-excluded / home / user / mnt / backup /
 wait
 sh / etc / backup.sh

bash has the interesting exec command which allows you replace the current shell with the command, this sends a HUP to all processes running in the shell
ie

exec /bin/bash  /etc/backup.sh

Try

wait $$

did work.

tks

---------- Post updated at 11:42 AM ---------- Previous update was at 11:02 AM ----------

when i type

exec /bin/bash  /etc/backup.sh

it stops all running process?

is I want to run more than one scrip, but one at time I tried to use:

exec /bin/bash  backup1.sh
exec /bin/bash  backup2.sh
exec /bin/bash  backup3.sh

but only runs backup1.sh

what am I doing wrong?

From the man page of man bash (Linux):

So the first exec replaces the current process (read: your shell script) and no further code from it will be executed. Just start them without it, and it should work as expected.

so how do I run more process but start the second just when the first is finished?

exec /bin/bash  backup1.sh exec /bin/bash  backup2.sh exec /bin/bash  backup3.sh

First, please start using [CODE] tags when posting code, etc...

Second, as I said before, and DGPickett said here, leave out the exec. It replaces the current script with the one you're calling, and it won't run any part of the original script from there on. Nothing. Nada. And as long as you don't put any script into the background the shell will dutifully wait for it to finish before starting the next one.

So how do I do what I want?

For example by reading, not just skimming, what was written before. Or do you want a ready-to-go, complete, pre-chewed solution that only requires a minimum of cognitive abiliy?