Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Richard Trussler
Added: Oct 23, 2018 10:00 AM
Views: 19
  1.  
  2. !/bin/bash
  3. dir1=/var/www/html/themes/sainsburys/export/
  4. dir2=/var/www/html/themes/sainsburys/pfsExport/
  5. FILE1=$(ls -t $dir1 | head -n1)
  6. FULL1=$dir1$FILE1
  7. FILE2=$(ls -t $dir2 | head -n1)
  8. FULL2=$dir2$FILE2
  9. sshpass -p DwfGl0bal$ sftp GlobalAware@212.250.156.71 <<< $"put $FULL1"
  10. sshpass -p DwfGl0bal$ sftp GlobalAware@212.250.156.71 <<< $"put $FULL2"
  11.