Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue Processing Bash Script After LFTP

Tags:

bash

lftp

I'd like to use lftp in the beginning of a bash script, but how do I exit lftp without stopping the script from processing? I've tried ending the lftp part with "exit", "quit", and "bye", but they all stop the script.

Previously, I split into two scripts and cron'ed them to run in the right order. Is it possible to combine them into one script?

like image 922
Nathan Avatar asked Sep 21 '26 13:09

Nathan


1 Answers

Or more explicitly, use << EOF.

e.g.

#!/bin/bash
#CMP 01.04.2013
#
#<<EOF below is the functional equivalent of hitting .Enter. on your keyboard.
#It allows the rest of the commands to be executed once connected

lftp -e 'mirror -R /home/pi/LocalDirToMirror ~/TargetDir' -u YourUsername,YourPassword  ftp://FTP_URL_Location <<EOF
quit 0
EOF
like image 92
CMP Avatar answered Sep 24 '26 06:09

CMP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!