title: wait for shell script to finish before going to next line with Cron
body: <p>--- file makebackup.sh</p>
  
  <pre><code>#!/bin/bash
  mysqldump --all-databases | gzip -9 &gt; /backup/temp_db.gz
  tar -Pcf /backup/temp_ftp.tar /public_html/
  tar -Pcf /backup/temp_backup.tar /home/temp_db.gz /backup/temp_ftp.tar
  wait %%
  /backup/upload.sh
  </code></pre>
  
  <p>--- file upload.sh</p>
  
  <pre><code>#!/usr/bin/expect -f
  
  # connect via scp
  spawn scp /backup/temp_backup.tar root@mybackup.com:/home/backup.tar
  #######################
  expect {
  -re ".*es.*o.*" {
  exp_send "yes\r"
  exp_continue
  }
  -re ".*sword.*" {
  exp_send "mypassword\r"
  }
  }
  interact
  </code></pre>
  
  <p>When i look at <code>/backup</code> folder i see all files are there. In proper size 
  When i look at destination site i see file that is 18 times less than what i have in source server in <code>/backup</code> folder.</p>
  
  <p>When i just run it as <code>./makebackup.sh</code> it works properly when i run trough cron it does not. Is there way to execute <code>backup/upload.sh</code> <strong>ONLY</strong> once prior commands are finished?</p>
  
  <pre><code>15 12 * * 1,3,5 /backup/makebackup.sh 2&gt;&amp;1 &gt;&gt; /var/log/cron_makebackup.log
  </code></pre>
  
  <p>Cron log does not say anything at else than when i run it manually.</p>