Hi,
I have made a but of a simple error somewhere in a script I am writing. I blame it on lack of practice as it's the first script I've done since being on maternity leave for a year... I could not get my head around the quotes at all!
And yeah I know about the password in plain text just live with it for now.
Here goes:
Code:
#!/bin/bash
R_FTP='someip'
USR='user'
PSWD='password'
L_DIR='/local/dir/'
R_DIR='/remote/dir/'
TO='set net:timeout 30'
/usr/bin/lftp -e \'"$TO; mirror -R $L_DIR $R_DIR"\' -u $USR,$PSWD $R_FTP
If I pop echo in front of the /usr/bin/lftp the output is as I expect and that works fine if copied onto the command line.
If I try to run the script however it seems to ignore the lftp and I get:
Unknown command `set net:timeout 30; mirror -R /local/dir/ /remote/dir/'.
I'd be grateful for a bit of assistance, I need to get the data uploaded quickly!
Cheers
Emma