title: LFTP and SFTP not working using crontab
body: <p>I am using below script :</p>
  
  <pre><code>script_home=/home/insetl/ppp_scripts/prod/VSAVS
  date_var=`date +'%Y%m%d' -d "0 days ago"`
  date_var1=`date +'%Y%m%d' -d "1 days ago"`
  
  lftp&lt;&lt;END_SCRIPT
  open sftp://213.239.205.74
  user sftpvuclip LW?T8e62
  set xfer:clobber on
  get Vuclip_C2B_TRX-${date_var}0030.csv
  bye
  END_SCRIPT
  </code></pre>
  
  <p>sudo grep -v '^ACC' $script_home/Vuclip_C2B_TRX-${date_var}0030.csv</p>
  
  <blockquote>
    <p>/home/insetl/ppp_scripts/prod/VSAVS/Vuclip_C2B_TRX-${date_var}.csv  </p>
  </blockquote>
  
  <p>scp $script_home/Vuclip_C2B_TRX-${date_var}.csv $TARGET_HOST:/tmp/  </p>
  
  <p>psql -h $TARGET_HOST -d $TARGET_DB -p 5432 &lt;&lt; ENDSQL<br>
  delete from vsavs_offline_revenue_dump  where update_date like '${date_var2}%';<br>
  copy vsavs_offline_revenue_dump from '/tmp/Vuclip_C2B_TRX-${date_var}.csv' with   delimiter as ',';  </p>
  
  <p>update fact_channel_daily_aggr a<br>
  set revenue_from_file = (select sum(substr(amount,3)::float) from   vsavs_offline_revenue_dump where to_char(to_timestamp(update_date, 'dd-mm-yyyy' ),'YYYYMMDD') = ${date_var1})
  where product_sk = 110030 and
  a.date_id=${date_var1};</p>
  
  <p>ENDSQL  </p>
  
  <p>The script runs completely fine when run manually. However the LFTP/SFTP part of the script doesnt run when ran through crontab. Please advise the solution for the same.</p>
  
  <p>Output :</p>
  
  <p>/home/insetl/ppp_scripts/prod/VSAVS/sftp_pull_in.sh: line 9: 08/02/2017: No such file or directory
  20170209
  /home/insetl/ppp_scripts/prod/VSAVS
  grep: /home/insetl/ppp_scripts/prod/VSAVS/Vuclip_C2B_TRX-201702090030.csv: No such file or directory
  DELETE 0
  COPY 0
  UPDATE 20</p>