Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Friends
I wish to have a script that will do a lftp mirror
that will sync up a local dir to the ftp dir
local dir is is an external drive on my dsktop
/media/facing_history_1/00
where facing_history_1 is the drive and 00 is a dir I wish for the files to go to
the remote dir is on the ftp server
172.16.100.101 ,
the user is editor
the password apple
and the dir that I wish to source from is : array1/f_t
Note: i can do it manually - but wish to have a script that i can cron.
here is the script I am currently trying
<code>
#!/bin/bash
#########_______ test of mirror
log=~/log/f_h_logfile.txt
batch=00
dest=/media/facing_history_1/$batch
cd $dest
echo start $(date) >> $log
currently when I run this script
i DO get to the ftp server
but it 'stalls' at root - meaning the cd array1/f_t never happens
nor does the mirror -c happen
when i run it I am logged into the server
and in that shell i can do a dir and see where i am and I can manually put in : cd array1/f_t , and that gets me there
and I can manually put in mirror -c , and that pulls the files.
so __ how do i put this all on 1 line and have it all happen
as you can see i did try - all 1 line -
lftp 172.16.100.101 -u editor,apple cd array1/f_t mirror -c
and I have tried in 3 lines
lftp 172.16.100.101 -u editor,apple
cd array1/f_t
mirror -c
but it stalls after the logIn
ok I have something that is sorta working
<code>
#!/bin/bash
#########_______ test of mirror
log=~/log/f_h_logfile.txt
batch=00
dest=/media/facing_history_1/$batch
cd $dest
echo start $(date) >> $log
but it does not log
lftp -c 'open -e "set ftp:list-options -a; mirror -a -v array1/f_t/ ./media/facing_history_1/00" -u editor,apple 172.16.100.101 >> $log'
isn the same as
lftp -c 'open -e "set ftp:list-options -a; mirror -a -v array1/f_t/ ./media/facing_history_1/00" -u editor,apple 172.16.100.101'
and it does not go to
echo end $(date) >> $log
echo ............ >> $log
i suppose that is the exit
but I was thinking the exit -- there-- would exit the ftp
and --sorta-- drop back into bash space
how might one do that
I am also trying to have a better understanding of what happens w the
lftp -c 'open -e "set ftp:list-options -a; mirror -a -v
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.