I have a script I made to create a backup. I need to make sure the backup is ready before it runs the /home/ftp.sh command. How can I do so? I use CentOS 5.6
#!/bin/bash
tar -Pcf /home/temp_backup.tar /home/myfiles/
wait %%
/home/ftp.sh
|
I have a script I made to create a backup. I need to make sure the backup is ready before it runs the
|
||||
|
You're already doing it. Waiting for a command to finish is the shell's normal behavior. (Try typing You can delete the Do you have any evidence that the Incidentally, it's a bit odd to have things other than users' home directories directly under (I know most of this was already covered in comments, but I thought there should be an actual answer.) |
|||
|
|
|
You can use:
Delete the |
||||
|
waitmakes no sense. How are you defining "backup is ready"? It looks fine to me in its current state (although the spuriouswaitis unnecessary). – Chris Down Dec 10 '11 at 0:06tarcommand is not being backgrounded, so the script has no choice but to wait for it to finish before executing the/home/ftp.shscript. – Tim Kennedy Dec 10 '11 at 1:19