Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. # set up log in info.
  2. HOST=$1
  3. USER=$2
  4. PASS=$3
  5.  
  6. #local file info
  7. FROMDIR=$4
  8. FROMFILE=$5
  9.  
  10. #remote file info
  11. TODIR=$6
  12. TOFILE=$7
  13.  
  14. #sent dir
  15. SENTDIR=$FROMDIR/../sent
  16.  
  17. #log dir
  18. DIRNAME=`/usr/bin/dirname $0`
  19. LOGDIR=$DIRNAME/../log
  20. LOGFILE=$LOGDIR/$5.log
  21.  
  22.  
  23. #####################################################
  24. #
  25. # move the file to the pickup folder
  26. #
  27. #####################################################
  28.  
  29. if ! test -d $LOGDIR
  30. then
  31. /usr/bin/mkdir $LOGDIR
  32. fi
  33.  
  34.  
  35.  
  36. if `/usr/bin/cp "$FROMDIR/$FROMFILE" "$TODIR/$TOFILE"`
  37. then
  38. echo `date` >> $LOGFILE
  39. echo "Successfully copied file from $FROMDIR/$FROMFILE to $TODIR/$TOFILE" >> $LOGFILE
  40. exit 10;
  41. else
  42. echo `date` >> $LOGFILE.failed
  43. echo "Colud not copy file from $FROMDIR/$FROMFILE to $TODIR/$TOFILE" >> $LOGFILE.failed
  44. exit 1;
  45. fi
  46.  
  47. /foo/sing/song
  48. /tommy
  49. /chicken
  50. /in
  51. /out
  52. /burger
  53. /in
  54. /out
  55. etc...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement