#] #] ********************* #] "$d_SysMaint"'internet & wifi/lftp notes.txt' www.BillHowell.ca 10Sep2018 initial # view in text editor, using constant-width font (eg courier), tabWidth = 3 # 25Nov2020 modifications to update my webSite bash-related!! : "$d_SysMaint"'webSite/0_website bash notes.txt' - bash-related webSite maintenance & tracking "$d_SysMaint"'webSite/1_website bash upload instructions.txt' - bash-related webSite instructions "$d_SysMaint"'internet & wifi/lftp notes.txt' "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" - main tool for webSite updates (not FileZilla) QNial-related : "$d_Qndfs"'webSite/0_webSite QNial notes.txt' - QNial webSite notes for maintenance & tracking "$d_Qndfs""webSite/1_webSite QNial process instructions.txt" - fixes for webSite link problems USE lftp for [webSite, ssh] deletion of files not on d_webSite - much slower, hopefully more reliable? $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" >> isn't working well, script problems? 09Dec2020 WARNING! did my lftp settings pass permissions to the website, denying access to the public for many directories? vsftpd - very fast, use this? (secure - don't need for my website, though) 05Jul2022 : DON'T use FileZilla for massive stuff!!!! - reloads most of webSite every time!!!! just use it for very limited transfers - manually-sellected, small directories etc #48************************************************48 #24************************24 # Table of Contents, generate with : # $ grep "^#]" "$d_SysMaint"'internet & wifi/lftp notes.txt' | sed "s/^#\]/ /" # ********************* "$d_SysMaint"'internet & wifi/lftp notes.txt' 08Jun2021 more check on other online webPages - expecially [conference guides, menus] 27Mar2021 check some online webPages - expecially [conference guides, menus] 27Mar2021 working version 27Mar2021 more work on script 27Mar2021 delete filePaths listed in a file 26Mar2021 How to list directory content of remote FTP, recursively 26Mar2021 search "Linux lftp and list a remote directory" 09Dec2020 WARNING! did my lftp settings pass permissions to the website, denying access to the public for many directories? 09Dec2020 I need to write my own QNial program using wput - that [plans, execute, tracks] progress of uploads!! 09Dec2020 search "lftp is slow?" 09Dec2020 [lftp, vsftp] uploading software 25Nov2020 "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" 24Nov2020 search "Linux lftp versus FileZilla" 29Oct2018 lftp tests - want an update script! 10Sep2018 simple tests of lftp 10Sep2018 lftp man docs #24************************24 # Setup, ToDos, #24************************24 #08********08 #] ??Jul2022 #08********08 #] ??Jul2022 #08********08 #] ??Jul2022 #08********08 #] 07Jul2022 lftp update "$d_web"'Personal/230115 Calgary - New Zealand/' created "$d_PROJECTS""bin - secure/lftp update specified dir.sh" #08********08 #] 05Jul2022 Update webSite - I just let it run inefficiently $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" # Take your pick : wwwBillHowell_update >> WEIRD! - finished only a few seconds after I woke up and came to check the computer! 06/07/2022-06:52:02 Finished upload... >> Initial dateTime of the log file must have been over-written by wwwBillHowell_update so I put it at the end... # lines in file : 4,092 p_log="$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca log.txt" 10,165 "$d_webRawe"'webWork files/z_Archive/220705 18h19m webSite file listing.txt' >> wwwBillHowell_update moved HF of the files??? insane check webSite via browser : >> CRAP!! all html files were corrupted!! rsync script fucked up!! "$d_bin"'rsync website excludes.txt' didn't exclude .html !!??! >> perfect time to setup to 'no index.html file', so directory folders easy to use! 0_README first.txt 05Jul2022 I have renamed my previous 'index.html' file to 'home.html', so that user who go to the URL 'http://www.BillHowell.ca' will see the directory listing of my root folder, and not my home webPage. The main advantage is that I (and you) can easily follow my browser's directory listings up and down the entire webSite, rather than being "enslaved and impeded" by my webPages and their menus. On the other hand, by clicking on any of my webPages, I (you) can follow the menus and see the webPage [instruction, information, image]s. For a minor initial inconvenience to first-time visitors 05Jul2022 LINKS AND IMAGES DON'T WORK!!! For a year and a half or more, I have been completely revamping my software programs that I've written in the QNial programming language, starting with the core [utility, library]s. That means that my webSite management programs are in "suspended animation" until I finish the revamps. At least all files seem accessible... [chmod, chown] #08********08 #] 05Jul2022 Compare directory listings [d_webSite,webOnLn] $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" # Take your pick : ls_remote 220705 18h19m diff d_webRawe vs WebSite files.txt 220705 18h19m webRawe file listing.txt 220705 18h19m WebSite file deletes.txt - everything made sense. 220705 18h19m WebSite file downlds.txt 220705 18h19m webSite file listing.txt 220705 18h19m webSite file noroots.txt 220705 21h11m WebSite directory raw deletes.txt >> very effective bash function, if I say so myself I should have move [history, other] dirs in webSiteOnLn to save a lot of file transfers 08********08 #] 08Jun2021 more check on other online webPages - expecially [conference guides, menus] +-----+ 9. Upload to website - use "$d_PROJECTS"'Website secure/lftp update www-BillHowell-ca.sh' [FileZilla, lftp, wget, curl] - which? FileZilla is [fastest, easiest] but may re-upload a huge pile! It is easy to make serious mistakes My own previous notes in 'lftp update www-BillHowell-ca.sh' : # webSite_to_webOnln use "$d_SysMaint""Linux/curl - [exist, [up, down]load] [files, url] notes.txt" # 25May2021 need to modify code above!!!! https://www.baeldung.com/linux/curl-wget >> I went with lftp - VERY slow, $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" 08/06/2021-22:43:21 Starting upload... 09/06/2021-01:18:28 Finished upload... 02:35:07 duration - not ffa, but do-able It would take forever to do full website, 09Jun2021 lftpUpload - rather than commenting out" code, it would be far safer to call with arguments! +----+ BAD! see "$d_SysMaint""internet & wifi/lftp [up,down]loads, mirror notes.txt" $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" >> OOPS!! # webSite_to_webOnln use "$d_SysMaint""Linux/curl - [exist, [up, down]load] [files, url] notes.txt" # 25May2021 need to modify code above!!!! In sh script, I made sure that wwwBillHowell_update was selected : # Take your pick : # ls_remote # ls_remote_tests # delete_WebSite_diffs wwwBillHowell_update # wwwBillHowell_html_update 08********08 #] 27Mar2021 check some online webPages - expecially [conference guides, menus] All looks good to me - must test conference guides!!!! 08********08 #] 27Mar2021 working version delete_WebSite_diffs() { p_log="$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca log.txt" p_flist_deletes="$d_logLists""210327 11h05m WebSite delete test.txt" # p_flist_deletes="$d_logLists""210327 11h05m WebSite file deletes.txt" p_urlDeleteScript="/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" # p_urlDeleteScript="/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" PROTOCOL="ftp" URL="billhowell.ca" LOCALDIR="$d_webRawe" REMOTEDIR="/billhowell.ca" USER="billhowellweb" PASS="ad91019a" REGEX="*" becho "$(date +"%e%B%Y %kh%Mm") Starting delete_WebSite_diffs..." lftp $PROTOCOL://$URL <<- DELTER user $USER "$PASS" source "/media/bill/Dell2/Website - raw/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" close DELTER becho "$(date +"%e%B%Y %kh%Mm") Finished delete_WebSite_diffs..." } run results : >> most are dir errors (which is fine) +-----+ $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" 27March2021 16h52m Starting delete_WebSite_diffs... rm: Access failed: 550 billhowell.ca: Is a directory (/billhowell.ca) rm: Access failed: 550 billhowell.ca/0_website notes.txt: No such file or directory (/billhowell.ca/0_website notes.txt) rm: Access failed: 550 billhowell.ca/201018 Howell, Bill photo.png: No such file or directory (/billhowell.ca/201018 Howell, Bill photo.png) rm: Access failed: 550 billhowell.ca/Bill Howells videos/120214 Venus et Mars, au dela d'une histoire d amour/Mythology.flv: No such file or directory (/billhowell.ca/Bill Howells videos/120214 Venus et Mars, au dela d'une histoire d amour/Mythology.flv) rm: Access failed: 550 billhowell.ca/Charvatova solar inertial motion & activity/TMP31F.htm: No such file or directory (/billhowell.ca/Charvatova solar inertial motion & activity/TMP31F.htm) rm: Access failed: 550 billhowell.ca/Climate and sun/Join JPL and Milankovic base data: Is a directory (/billhowell.ca/Climate and sun/Join JPL and Milankovic base data) rm: Access failed: 550 billhowell.ca/Climate - Kyoto Premise fraud/FinPost Deniers - Abdussamatov, look to Mars for the truth on global warming.pdf: No such file or directory (/billhowell.ca/Climate - Kyoto Premise fraud/FinPost Deniers - Abdussamatov, look to Mars for the truth on global warming.pdf) rm: Access failed: 550 billhowell.ca/Crazy ideas: Is a directory (/billhowell.ca/Crazy ideas) rm: Access failed: 550 billhowell.ca/economics, markets/SP500/FedReserve control zone: Is a directory (/billhowell.ca/economics, markets/SP500/FedReserve control zone) rm: Access failed: 550 billhowell.ca/economics, markets/SP500/PineScript story: Is a directory (/billhowell.ca/economics, markets/SP500/PineScript story) rm: Access failed: 550 billhowell.ca/.goutputstream-VMLO0V: No such file or directory (/billhowell.ca/.goutputstream-VMLO0V) rm: Access failed: 550 billhowell.ca/Publications: Is a directory (/billhowell.ca/Publications) rm: Access failed: 550 billhowell.ca/Puetz greatest of cycles: Is a directory (/billhowell.ca/Puetz greatest of cycles) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Introduction: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Introduction) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Language Definition: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Language Definition) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/NialIntroduction: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/NialIntroduction) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/V6LanguageDefinition: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/V6LanguageDefinition) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/docs/old NSL website files: Is a directory (/billhowell.ca/Qnial/Qnial_bag/docs/old NSL website files) rm: Access failed: 550 billhowell.ca/Qnial/Qnial_bag/Manuals: Is a directory (/billhowell.ca/Qnial/Qnial_bag/Manuals) rm: Access failed: 550 billhowell.ca/Randell Mills - hydrinos: Is a directory (/billhowell.ca/Randell Mills - hydrinos) rm: Access failed: 550 billhowell.ca/Social media: Is a directory (/billhowell.ca/Social media) rm: Access failed: 550 billhowell.ca/Software programming & code/System_maintenance: Is a directory (/billhowell.ca/Software programming & code/System_maintenance) rm: Access failed: 550 billhowell.ca/Software programming & code/System_maintenance/Software options: Is a directory (/billhowell.ca/Software programming & code/System_maintenance/Software options) rm: Access failed: 550 billhowell.ca/Solar modeling and forecasting/Charvatova related files: Is a directory (/billhowell.ca/Solar modeling and forecasting/Charvatova related files) rm: Access failed: 550 billhowell.ca/z_Not posted yet: Is a directory (/billhowell.ca/z_Not posted yet) rm: Access failed: 550 billhowell.ca/z_Not posted yet/Paul L Vaughan: Is a directory (/billhowell.ca/z_Not posted yet/Paul L Vaughan) 27March2021 16h53m Finished delete_WebSite_diffs... +-----+ double-check d_webRawe versus webURL : ls_remote 210327 17h17m WebSite file deletes.txt : rm "/billhowell.ca" rm "/billhowell.ca/Climate and sun/Join JPL and Milankovic base data" rm "/billhowell.ca/Crazy ideas" rm "/billhowell.ca/economics, markets/SP500/FedReserve control zone" rm "/billhowell.ca/economics, markets/SP500/PineScript story" rm "/billhowell.ca/Publications" rm "/billhowell.ca/Puetz greatest of cycles" rm "/billhowell.ca/Qnial/Qnial_bag/docs" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Introduction" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/Language Definition" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/NialIntroduction" rm "/billhowell.ca/Qnial/Qnial_bag/docs/Manuals/pandoc tools/V6LanguageDefinition" rm "/billhowell.ca/Qnial/Qnial_bag/docs/old NSL website files" rm "/billhowell.ca/Qnial/Qnial_bag/Manuals" rm "/billhowell.ca/Randell Mills - hydrinos" rm "/billhowell.ca/Social media" rm "/billhowell.ca/Software programming & code/System_maintenance" rm "/billhowell.ca/Software programming & code/System_maintenance/Software options" rm "/billhowell.ca/Solar modeling and forecasting/Charvatova related files" rm "/billhowell.ca/System_maintenance/Linux/lftp man.txt" rm "/billhowell.ca/z_Not posted yet" rm "/billhowell.ca/z_Not posted yet/Paul L Vaughan" >> only a few leftovers - mostly directories (empty?) leave it for now 08********08 #] 27Mar2021 more work on script # p_flist_deletes="$d_logLists""210327 11h05m WebSite delete test.txt" # p_urlDeleteScript="/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" # p_flist_deletes="$d_logLists""210327 11h05m WebSite file deletes.txt" # p_urlDeleteScript="/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" # x source '"$p_urlDeleteScript"' # source "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" # source: /billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test.txt: # No such file or directory # source -e cat "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test fList only.txt" # cat: /billhowell.ca/System_maintenance/webSite/210327: No such file or directory # cat: 11h05m: No such file or directory # cat: WebSite: No such file or directory # cat: delete: No such file or directory # cat: test: No such file or directory # cat: fList: No such file or directory # cat: only.txt: No such file or directory source "/media/bill/Dell2/Website - raw/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" 27March2021 16h37m Starting delete_WebSite_diffs... 27March2021 16h37m Finished delete_WebSite_diffs... # x cat '"$p_urlDeleteScript"' # OK cat "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test.txt" # x cat "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test fList only.txt" | rm # rm: missing operand #Try 'rm --help' for more information. # cat "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test fList only.txt" | xargs -0 -ILINE rm "LINE" # rm: cannot remove '''/billhowell.ca/0_website notes.txt'$'\n''/billhowell.ca/201018 Howell, Bill photo.png'$'\n''/billhowell.ca/Bill Howells videos/120214 Venus et Mars, au dela d'\''une histoire d amour/Mythology.flv'$'\n''/billhowell.ca/Charvatova solar inertial motion & activity/TMP31F.htm'$'\n''/billhowell.ca/Climate - Kyoto Premise fraud/FinPost Deniers - Abdussamatov, look to Mars for the truth on global warming.pdf'$'\n': No such file or directory # x cat "/billhowell.ca/System_maintenance/webSite/210327 11h05m WebSite delete test fList only.txt" | tr \n \0 | xargs -0 -ILINE rm "LINE" # rm: cannot remove '''/billhowell.ca/0_website 0otes.txt'$'\n''/billhowell.ca/201018 Howell, Bill photo.p0g'$'\n''/billhowell.ca/Bill Howells videos/120214 Ve0us et Mars, au dela d'\''u0e histoire d amour/Mythology.flv'$'\n''/billhowell.ca/Charvatova solar i0ertial motio0 & activity/TMP31F.htm'$'\n''/billhowell.ca/Climate - Kyoto Premise fraud/Fi0Post De0iers - Abdussamatov, look to Mars for the truth o0 global warmi0g.pdf'$'\n': No such file or directory # OK ls 'System_maintenance/webSite/' 08********08 #] 27Mar2021 delete filePaths listed in a file bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" Far easier to do mirror with delete extra remote files, but I'll need a list-specific thing anyways. How do I handle [local, relm] code mix? lftp $PROTOCOL://$URL <<- UPLOAD user $USER "$PASS" cd $REMOTEDIR while read -u 9 line; do rm "$line" done 9< "$p_flist_deletes" close UPLOAD +-----+ https://stackoverflow.com/questions/58827509/lftp-delete-multiples-files-with-bash Looks xargs is unknown cmd for lftp after man lftp. And xargs rm is deleting local files not remote files. so please use xargs as below, it works for me. lftp -e "ls -1tr $REMOTE_DIR/full_backup_ftp*; quit" -u $USER,$PASSWORD $HOST | head -$NB_BACKUP_TO_RM | xargs -I {} lftp -e 'rm '{}'; quit' -u $USER,$PASSWORD $HOST answered Nov 13 '19 at 4:59 suiwenfeng Starting SFTP connection can be time consuming. Slightly modified solution to avoid multiple lftp sessions below. It will perform much better the the alternative solution, especially if large number of files have to be purged. Basically, leveraging lftp flexibility to mix lftp command with external commands. It creates a command file with a series of 'rm' (leveraging head ,xargs, ...), and executing those commands INSIDE the same lftp session. Also note that lftp 'ls' does not allow wildcard, use 'cls' instead Make sure you test this carefully, because of potential removal of important files lftp -e $USER,$PASSWORD $HOST <<__CMD__ cls -1tr $REMOTE_DIR/full_backup_ftp* | head -$NB_BACKUP_TO_RM | xarg -I{} echo rm {} > rm_list.txt source rm_list.txt __CMD__ Or with one liner, using 'lftp' ability to execute dynamically generated command (source -e). It eliminate the temporary file. lftp -e $USER,$PASSWORD $HOST <<__CMD__ source -e 'cls -1tr $REMOTE_DIR/full_backup_ftp* | head -$NB_BACKUP_TO_RM | xarg -I{} echo rm {}' __CMD__ edited Nov 13 '19 at 10:50 answered Nov 13 '19 at 10:05 dash-o >> Howell try first approach using fileList : lftp -e $USER,$PASSWORD $HOST <<__CMD__ cls -1tr $REMOTE_DIR/full_backup_ftp* | head -$NB_BACKUP_TO_RM | xarg -I{} echo rm {} > rm_list.txt source rm_list.txt __CMD__ >> NYET - far easier to use source command directly? put 'rm ' at start of each line of deleteList source file source -e command Execute commands recorded in file or returned by specified external command. source ~/.lftp/rc source -e echo help +-----+ https://unix.stackexchange.com/questions/510295/lftp-remove-files-from-remote-server-while-uploading-via-lftp-mirror-reverse The solution was at hand. While digging through LFTP manual I found that mirror command has a --delete option which perfectly suits my needs. --delete delete files not present at the source ~ LFTP Manual I changed glob -a rm -r -f * mirror --reverse $local_directory . to mirror --reverse --delete $local_directory . answered Apr 3 '19 at 14:44 Prolog >> Great for mirroring. Not pecific to deleting list of files. Right now, to get rid of this headache, I should simply mirror d_webSite -> webSite!! From now on, [d_webSite,webSite] would have the same content! Modify wwwBillHowell_update() 08********08 #] 26Mar2021 How to list directory content of remote FTP, recursively https://stackoverflow.com/questions/98224/how-to-list-directory-content-of-remote-ftp-recursively How to list directory content of remote FTP, recursively >> great answer by : edited Nov 11 '16 at 20:05 Alexis Wilke 14.9k88 gold badges5757 silver badges109109 bronze badges answered Sep 19 '08 at 0:12 Kent Fredric 08********08 #] 26Mar2021 search "Linux lftp and list a remote directory" $ grep --invert-match 'Diversity - i9018xtp.default' "$d_webRawe""webWork files/210326 16h49m webSite file listing.txt" >"$d_webRawe""webWork files/210326 17h23m webSite file listing no Diversity.txt" +-----+ https://stackoverflow.com/questions/98224/how-to-list-directory-content-of-remote-ftp-recursively How to list directory content of remote FTP, recursively Asked 12 years, 6 months ago Active 3 years, 10 months ago Viewed 49k times $ lftp mirror.3fl.net.au lftp mirror.3fl.net.au:~> ls drwxr-xr-x 14 root root 4096 Nov 27 2007 games drwx------ 2 root root 16384 Apr 13 2006 lost+found drwxr-xr-x 15 mirror mirror 4096 Jul 15 05:20 pub lftp mirror.3fl.net.au:/> cd games/misc lftp mirror.3fl.net.au:/games/misc>find ./ ./dreamchess/ ./dreamchess/full_game/ ./dreamchess/full_game/dreamchess-0.2.0-win32.exe ./frets_on_fire/ ./frets_on_fire/full_game/ ./frets_on_fire/full_game/FretsOnFire-1.2.451-macosx.zip ./frets_on_fire/full_game/FretsOnFire-1.2.512-win32.zip ./frets_on_fire/full_game/FretsOnFire_ghc_mod.zip ./gametap_setup.exe ...... lftp mirror.3fl.net.au:/games/misc> du gametap_setup.exe 32442 gametap_setup.exe lftp mirror.3fl.net.au:/games/misc> du -sh gametap_setup.exe 32M gametap_setup.exe lftp mirror.3fl.net.au:/games/misc> Share Follow edited Nov 11 '16 at 20:05 Alexis Wilke 14.9k88 gold badges5757 silver badges109109 bronze badges answered Sep 19 '08 at 0:12 Kent Fredric >> Howell : find 08********08 #] 09Dec2020 WARNING! did my lftp settings pass permissions to the website, #] denying access to the public for many directories? https://stackoverflow.com/questions/13859799/lftp-how-to-recursively-set-permissions-firstly-by-directory-than-by-file lftp: how to recursively set permissions; firstly by directory than by file Solution As far as a solution to your problem is concerned, you can try something along the lines of: #!/bin/bash server="ftp.foo.bar" root_folder="/my/path" { { lftp "${server}" <> Howell's command in bash file "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" : mirror --reverse --only-newer --log=$LOG "/media/bill/HOWELL_BASE/Website/" "/billhowell.ca/" man lftp n -e, --delete delete files not present at [local, remote] site DON'T USE!!!??? but simple lftp does this?? (--dry-run) n -N, --newer-than=SPEC [up, down]load only files newer than specified time y -n, --only-newer [up, down]load only newer files (-c won't work) n -p, --no-perms don't set file permissions !!!?? sets to public on webOnln? y --log=FILE write lftp commands being executed to FILE n = use in script, n = don't use When uploading to server, get is used? presumably this is from the server perspective? How do I send dry-run results to a log file? https://linoxide.com/linux-how-to/lftp-commands/ 12 lftp Commands to Manage Files with Examples Updated September 2, 2020By Mihajlo Milenovic >> best description so far, details balance https://stackoverflow.com/questions/9611271/why-does-the-lftp-mirror-command-chmod-files Why does the lftp mirror command chmod files asked Mar 8 '12 at 0:28 Jeremy Use the -p option and it shouldn't try to change permissions. I've never sent to a windows host, but you are correct in that it shouldn't do anything to the permission levels on the windows box. share improve this answer follow answered Mar 9 '12 at 19:08 markdjones82 >> Howell : no that a dry-run of a siingle fe I've successfully uploaded automatically uses -p (--no-perms) $ bash "$d_PROJECTS""bin - secure/lftp update www-BillHowell-ca.sh" mkdir -p ftp://billhowellweb:ad91019a@billhowell.ca/billhowell.ca/economics,%20markets/SP500/multi-fractal/ https://serverok.in/upload-files-using-lftp Upload all files to FTP server using lftp Posted on July 17, 2019 (July 17, 2019) by ServerOk To upload all files from local folder to remote server, run lftp -d -u FTP_USER,FTP_PASSWORD FTP_SERVER_IP set ftp:ssl-allow no mirror -R /var/flashwebhost/vshare2.7/ public_html YIKES : chmod, get, -e (delete existing or not in [remote, local] https://www.inmotionhosting.com/support/website/using-lftp-mirror-to-copy-your-website-files/ Using lftp mirror to copy your website files Updated on August 29, 2019 by Jacob Nicholson >> uses ssh approach, I need to keep this simple do a test with an already-transfered file : 24************************24 #] 24Nov2020 search "Linux lftp versus FileZilla" 05-----05 https://unix.stackexchange.com/questions/254841/lftp-script-to-download-files First: Create a script. You can call it whatever you want. I will call it downloader.sh. #!/bin/bash PROTOCOL="ftp" URL="server.example.com" LOCALDIR="/home/user/downloads" REMOTEDIR="dir/remote/server/" USER="user" PASS="password" REGEX="*.txt" LOG="/home/user/script.log" cd $LOCALDIR if [ ! $? -eq 0 ]; then echo "$(date "+%d/%m/%Y-%T") Cant cd to $LOCALDIR. Please make sure this local directory is valid" >> $LOG fi lftp $PROTOCOL://$URL <<- DOWNLOAD user $USER "$PASS" cd $REMOTEDIR mget -E $REGEX DOWNLOAD if [ ! $? -eq 0 ]; then echo "$(date "+%d/%m/%Y-%T") Cant download files. Make sure the credentials and server information are correct" >> $LOG fi Second: Add it to crontab. If you want to execute it every exact 15 minutes inside an hour: 45,30,15,00 * * * * /home/user/downloader.sh >/dev/null 2>&1 If you want to execute it each 15 minutes no matter what is the starting minute: */15 * * * * /home/user/downloader.sh >/dev/null 2>&1 Explaining the variables: PROTOCOL - What protocol to use. lftp supports a good range of them: ftp, ftps, http, https, hftp, fish, sftp and file. https and ftps require lftp to be compiled with OpenSSL or GNU TLS support. URL- Name or IP of the server. You can even add :PORT at the end if your server doesn't use the default port of the protocol being used. LOCALDIR - Where to save the files. REMOTEDIR - Where to cd on the remote server to get the files. USER and PASSWORD - ftp credentials. REGEX - Regular expression to filter files to download. It can be useful if you want to download only files of a determined extension, for example. Use * if you want to download everything. LOG - Logfile location. Explaining some code logic: 1. - if if [ ! $? -eq 0 ]; then fi The $? variable is a special bash variable that means "status code of last command". Bash always return zero on successful command executions so, comparing -eq (equal to) with the starting ! (negative) on an if should be enough to see if cd and lftp had issues during execution. If you want a better log of what happened, you will have to crawl through those commands' documentation. 2. - heredocs lftp $PROTOCOL://$URL <<- DOWNLOAD DOWNLOAD bash heredocs. It's a way to say "feed this command with this input list". I've named the limit string DOWNLOAD so, everything between <<- DOWNLOAD and DOWNLOAD will be input to lftp. You will see examples on the internet with << symbol but I prefer the <<- version since it supports indentation. 3. - lftp commands user $USER "$PASS" cd $REMOTEDIR mget -E $REGEX These are internal commands of lftp that means respectively, auth the user with $USER login and "$PASS" password, change to $REMOTEDIR and bulk download anything with the $REGEX keywords. You can learn them by simply typing lftp, and as soon as an lftp shell is opened, type ? and press Enter or ? lftp-command-you-want and press Enter. Example: [root@host ~]# lftp lftp :~> ? ! (commands) alias [ []] attach [PID] bookmark [SUBCMD] cache [SUBCMD] cat [-b] cd chmod [OPTS] mode file... close [-a] [re]cls [opts] [path/][pattern] debug [|off] [-o ] du [options] exit [|bg] get [OPTS] [-o ] glob [OPTS] help [] history -w file|-r file|-c|-l [cnt] jobs [-v] [] kill all| lcd lftp [OPTS] ln [-s] ls [] mget [OPTS] mirror [OPTS] [remote [local]] mkdir [-p] module name [args] more mput [OPTS] mrm mv [re]nlist [] open [OPTS] pget [OPTS] [-o ] put [OPTS] [-o ] pwd [-p] queue [OPTS] [] quote repeat [OPTS] [delay] [command] rm [-r] [-f] rmdir [-f] scache [] set [OPT] [ []] site source torrent [-O ] ... user [] wait [] zcat zmore lftp :~> ? mget Usage: mget [OPTS] Gets selected files with expanded wildcards -c continue, resume transfer -d create directories the same as in file names and get the files into them instead of current directory -E delete remote files after successful transfer -a use ascii mode (binary is the default) -O specifies base directory or URL where files should be placed The knowledge related to know that mget would be the right command inside lftp came from reading manpages and searching for keywords like "bulk", "multi" or "mass", and knowing that the ftp(1) command also have the mget command so, probably lftp would have an equivalent. Manpage: lftp(1) share improve this answer follow edited Jun 20 '18 at 9:24 Pang 22722 silver badges77 bronze badges answered Jan 12 '16 at 13:02 user34720 24************************24 #] 29Oct2018 lftp tests - want an update script! $ lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial Password: cd ok, cwd=/ >> stuck with no response?!?? list root directory : lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca don't use normally!! : rm Authors' Guide files : lftp billhowellweb@BillHowell.ca:/> rm "/billhowell.ca/Neural nets/Conference guides/Author guide website/*" # NOTE: "lftp billhowellweb@BillHowell.ca:/> " is the prompt when in lftp # start : # $ lftp # remote ftp logon : # $ open -u billhowellweb billhowell.ca % then type remote # updates of Authors' Guide : # lftp billhowellweb@BillHowell.ca:/> mput -c -O "/billhowell.ca/Neural nets/Conference guides/Author guide website" "/media/bill/PROJECTS/Website/Neural nets/Conference guides/Author guide website/*" 24************************24 #] 10Sep2018 simple tests of lftp try directory listing : $ lftp -e "ls " -u billhowellweb, BillHowell.ca drwxrwx--- 4 billhowellweb billhowellweb 4096 Aug 6 2014 140706 BoG meeting at WCCI Beijing drwxrwxr-x 2 billhowellweb billhowellweb 4096 Aug 4 2014 Jobs drwxrwxr-x 31 billhowellweb billhowellweb 4096 Aug 27 19:32 billhowell.ca drwxrwx--- 2 billhowellweb billhowellweb 4096 Sep 22 2010 sessions-billhowell.ca drwxr-x--- 2 billhowellweb billhowellweb 4096 Jun 15 2016 tmp drwxrwx--- 2 billhowellweb billhowellweb 4096 Sep 22 2010 tmp-billhowell.ca >> Youpie! it worked, I'm logged in lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca drwxrwxr-x 7 billhowellweb billhowellweb 4096 Oct 28 2017 Bill Howells videos drwxrwxr-x 4 billhowellweb billhowellweb 4096 Sep 4 2008 Charvatova solar inertial motion & activity drwxrwxr-x 2 billhowellweb billhowellweb 4096 Sep 7 2012 Civilisations and sun drwxrwxr-x 2 billhowellweb billhowellweb 4096 Apr 2 2015 Climate - Kyoto Premise fraud drwxrwxr-x 9 billhowellweb billhowellweb 4096 Jun 24 16:37 Climate and sun drwxrwxr-x 2 billhowellweb billhowellweb 4096 Aug 22 18:21 Cool stuff -rw-rw-r-- 1 billhowellweb billhowellweb 1559 Oct 22 2013 Copyright ending.html drwxrwxr-x 2 billhowellweb billhowellweb 4096 May 3 2007 Crazy ideas -rw-rw---- 1 billhowellweb billhowellweb 5460 Nov 26 2014 Creative commons.png drwxrwx--- 3 billhowellweb billhowellweb 4096 Feb 24 2018 Electric Universe drwxrwxr-x 2 billhowellweb billhowellweb 4096 May 6 2007 Galactic rays and evolution -rw-rw-r-- 1 billhowellweb billhowellweb 126 May 4 2007 Header.html drwxrwx--- 2 billhowellweb billhowellweb 4096 Jan 12 2018 History drwxrwxr-x 3 billhowellweb billhowellweb 4096 Jun 19 18:40 Hodge-Podge -rw-rw---- 1 billhowellweb billhowellweb 12645 Sep 26 2017 Howell - Hope-to-do projects, active and planned.html -rw-rw---- 1 billhowellweb billhowellweb 106852 Aug 27 19:58 Howell - blog.html -rw-rw---- 1 billhowellweb billhowellweb 9995 Dec 23 2017 Howell - videos.html -rw-rw---- 1 billhowellweb billhowellweb 168457 Oct 12 2011 Howell 110902 - SPINE Systems design issues for social media, early draft.pdf -rw-rw-r-- 1 billhowellweb billhowellweb 120089 Jan 29 2007 Howell_photo_Nov05_light.jpg -rw-rw---- 1 billhowellweb billhowellweb 172267 Jun 6 2013 Howells Todos - Projects.png -rw-rw-r-- 1 billhowellweb billhowellweb 22494 Sep 27 2007 International Neural Network Society.bmp drwxrwxr-x 11 billhowellweb billhowellweb 4096 Aug 27 19:50 LibreOffice drwxrwx--- 2 billhowellweb billhowellweb 4096 Aug 14 22:58 Lies, Damned Lies, and Scientists -rw-rw---- 1 billhowellweb billhowellweb 15236 Nov 26 2014 MyTax - Peel Technologies.png drwxrwx--- 2 billhowellweb billhowellweb 4096 Sep 26 2017 Mythology -rw-rw-r-- 1 billhowellweb billhowellweb 81954 Sep 27 2007 National Post.bmp drwxrwxr-x 3 billhowellweb billhowellweb 28672 Jul 28 21:59 Neil Howell drwxrwxr-x 15 billhowellweb billhowellweb 4096 May 27 12:59 Neural nets drwxrwxr-x 2 billhowellweb billhowellweb 4096 Sep 30 2016 News -rw-rw-r-- 1 billhowellweb billhowellweb 8205 Sep 27 2007 Nial Systems Limited.JPG drwxrwxr-x 2 billhowellweb billhowellweb 4096 Feb 24 2018 Pandemics, health, and the Sun drwxrwx--- 2 billhowellweb billhowellweb 4096 May 28 2016 Paul L Vaughan drwxrwxr-x 3 billhowellweb billhowellweb 4096 Jun 13 17:36 Personal drwxrwxr-x 2 billhowellweb billhowellweb 4096 Jan 2 2015 Professional & Resume drwxrwxr-x 2 billhowellweb billhowellweb 4096 Jan 29 2007 Publications drwxrwxr-x 2 billhowellweb billhowellweb 4096 Sep 10 23:28 QNial drwxrwxr-x 2 billhowellweb billhowellweb 4096 Oct 7 2014 Sarah drwxrwx--- 2 billhowellweb billhowellweb 4096 Mar 10 2012 Social media -rw-rw-r-- 1 billhowellweb billhowellweb 1549 Jan 29 2007 Software projects.html drwxrwxr-x 3 billhowellweb billhowellweb 4096 Oct 11 2009 Solar modeling and forecasting drwxrwx--- 2 billhowellweb billhowellweb 4096 Apr 6 2014 Steven H Yaskell drwxrwx--- 2 billhowellweb billhowellweb 4096 Aug 27 2014 Studebaker pickup -rw-rw-r-- 1 billhowellweb billhowellweb 807 Jan 29 2007 Web page teste.html drwxrwxr-x 2 billhowellweb billhowellweb 4096 Oct 16 2007 Wickson website -rw-rw---- 1 billhowellweb billhowellweb 438 Nov 26 2014 gnu-head-mini.png -rw-rw---- 1 billhowellweb billhowellweb 11662 Aug 27 19:57 index.html >> Bougie, baby! lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial >> nothing, as I deleted everything lftp billhowellweb@BillHowell.ca:/> mirror -R "/media/bill/HOWELL_BASE/Website/QNial" "billhowell.ca/QNial" --no-recursion ln: Fatal error: 500 'SITE SYMLINK' not understood Total: 1 directory, 0 files, 1 symlink New: 0 files, 1 symlink 1 error detected lftp billhowellweb@BillHowell.ca:/> mirror -R "/media/bill/HOWELL_BASE/Website/QNial" --target-directory="billhowell.ca/QNial" --no-recursion --no-symlinks Total: 1 directory, 0 files, 1 symlink >> can't seem to mirror >> What about simple put? lftp billhowellweb@BillHowell.ca:/> put -c -O "billhowell.ca/QNial" "/media/bill/PROJECTS/Qnial/0_QNial error list.txt" 6511 bytes transferred in 5 seconds (1.2 KiB/s) lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial -rw-rw---- 1 billhowellweb billhowellweb 6511 Aug 31 19:52 0_QNial error list.txt >> OK! works lftp billhowellweb@BillHowell.ca:/> mput -c -d -O "billhowell.ca/QNial" "/media/bill/PROJECTS/Qnial/*" 6403225 bytes transferred in 39 seconds (159.6 KiB/s) Total 23 files transferred lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial -rw-rw---- 1 billhowellweb billhowellweb 6511 Aug 31 19:52 0_QNial error list.txt drwxrwxr-x 3 billhowellweb billhowellweb 4096 Sep 11 01:49 media lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial/media drwxrwxr-x 3 billhowellweb billhowellweb 4096 Sep 11 01:49 bill lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial/media/bill drwxrwxr-x 3 billhowellweb billhowellweb 4096 Sep 11 01:49 PROJECTS lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial/media/bill/PROJECTS drwxrwxr-x 2 billhowellweb billhowellweb 4096 Sep 11 01:50 Qnial lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial/media/bill/PROJECTS/Qnial -rw-rw---- 1 billhowellweb billhowellweb 6511 Aug 31 19:52 0_QNial error list.txt -rw-rw---- 1 billhowellweb billhowellweb 2827 Jun 1 18:16 0_QNial lessons.txt -rw-rw---- 1 billhowellweb billhowellweb 26199 May 17 19:20 0_QNial notes.txt -rw-rw---- 1 billhowellweb billhowellweb 4937 Aug 19 2017 0_setup description update.sh -rw-rw---- 1 billhowellweb billhowellweb 1477 Aug 19 2017 0_setup description.txt -rw-rw---- 1 billhowellweb billhowellweb 230 Jun 2 04:05 1 QNial error messages.txt -rw-rw---- 1 billhowellweb billhowellweb 14824 May 5 2016 1_Debug.odt -rw-rw---- 1 billhowellweb billhowellweb 3693 Apr 17 19:15 1_Debugging QNial build.txt -rw-rw---- 1 billhowellweb billhowellweb 16243 Jul 15 23:02 1_bug hunt template for ndf files.txt -rw-rw---- 1 billhowellweb billhowellweb 1700 Jan 23 2018 QNial_RaspPi install notes.txt -rw-rw---- 1 billhowellweb billhowellweb 2061263 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity-1.ogv -rw-rw---- 1 billhowellweb billhowellweb 2296811 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity-2.ogv -rw-rw---- 1 billhowellweb billhowellweb 10746 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity.ogv -rw-rw---- 1 billhowellweb billhowellweb 6168 Apr 10 2017 Working file 160911.ndf -rw-rw---- 1 billhowellweb billhowellweb 1374 May 28 03:49 Working file.ndf -rw-rw---- 1 billhowellweb billhowellweb 93634 Sep 7 20:10 auto.nlg -rw-rw---- 1 billhowellweb billhowellweb 581587 Nov 24 2014 nial -rw-rw---- 1 billhowellweb billhowellweb 556030 Jan 21 2018 nial7_Linux -rw-rw---- 1 billhowellweb billhowellweb 673128 Jan 23 2018 nial7_RaspPi -rw-rw---- 1 billhowellweb billhowellweb 4136 Apr 10 2017 quips - NN review tests.ndf -rw-rw---- 1 billhowellweb billhowellweb 13915 Jul 25 18:54 quips.ndf -rw-rw---- 1 billhowellweb billhowellweb 25546 Aug 31 16:16 setup.ndf -rw-rw---- 1 billhowellweb billhowellweb 246 Feb 13 2018 start_Lenovo.ndf >> Hilarious - I don't like -d !! lftp billhowellweb@BillHowell.ca:/> mput -c -O "billhowell.ca/QNial" "/media/bill/PROJECTS/Qnial/*" 6396714 bytes transferred in 41 seconds (153.3 KiB/s) Total 23 files transferred lftp billhowellweb@BillHowell.ca:/> ls billhowell.ca/QNial -rw-rw---- 1 billhowellweb billhowellweb 6511 Aug 31 19:52 0_QNial error list.txt -rw-rw---- 1 billhowellweb billhowellweb 2827 Jun 1 18:16 0_QNial lessons.txt -rw-rw---- 1 billhowellweb billhowellweb 26199 May 17 19:20 0_QNial notes.txt -rw-rw---- 1 billhowellweb billhowellweb 4937 Aug 19 2017 0_setup description update.sh -rw-rw---- 1 billhowellweb billhowellweb 1477 Aug 19 2017 0_setup description.txt -rw-rw---- 1 billhowellweb billhowellweb 230 Jun 2 04:05 1 QNial error messages.txt -rw-rw---- 1 billhowellweb billhowellweb 14824 May 5 2016 1_Debug.odt -rw-rw---- 1 billhowellweb billhowellweb 3693 Apr 17 19:15 1_Debugging QNial build.txt -rw-rw---- 1 billhowellweb billhowellweb 16243 Jul 15 23:02 1_bug hunt template for ndf files.txt -rw-rw---- 1 billhowellweb billhowellweb 1700 Jan 23 2018 QNial_RaspPi install notes.txt -rw-rw---- 1 billhowellweb billhowellweb 2061263 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity-1.ogv -rw-rw---- 1 billhowellweb billhowellweb 2296811 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity-2.ogv -rw-rw---- 1 billhowellweb billhowellweb 10746 Mar 6 2018 Scott, Donald 180818 The next step - new evidence of Birkeland current activity.ogv -rw-rw---- 1 billhowellweb billhowellweb 6168 Apr 10 2017 Working file 160911.ndf -rw-rw---- 1 billhowellweb billhowellweb 1374 May 28 03:49 Working file.ndf -rw-rw---- 1 billhowellweb billhowellweb 93634 Sep 7 20:10 auto.nlg drwxrwxr-x 3 billhowellweb billhowellweb 4096 Sep 11 01:49 media -rw-rw---- 1 billhowellweb billhowellweb 581587 Nov 24 2014 nial -rw-rw---- 1 billhowellweb billhowellweb 556030 Jan 21 2018 nial7_Linux -rw-rw---- 1 billhowellweb billhowellweb 673128 Jan 23 2018 nial7_RaspPi -rw-rw---- 1 billhowellweb billhowellweb 4136 Apr 10 2017 quips - NN review tests.ndf -rw-rw---- 1 billhowellweb billhowellweb 13915 Jul 25 18:54 quips.ndf -rw-rw---- 1 billhowellweb billhowellweb 25546 Aug 31 16:16 setup.ndf -rw-rw---- 1 billhowellweb billhowellweb 246 Feb 13 2018 start_Lenovo.ndf >> OK. FileZilla delete extra media lftp billhowellweb@BillHowell.ca:/> rm -r "billhowell.ca/QNial/media" rm ok, 27 files removed >> clean up muisdirected directories lftp billhowellweb@BillHowell.ca:/> mkdir "billhowell.ca/QNial/MY_NDFS" mkdir ok, `billhowell.ca/QNial/MY_NDFS' created lftp billhowellweb@BillHowell.ca:/> mput -c -O "billhowell.ca/QNial/MY_NDFS" "/media/bill/PROJECTS/Qnial/MY_NDFS/*" >> I seemed too slow - I Ctrl-C interrupted it lftp billhowellweb@BillHowell.ca:/> close -a lftp billhowellweb@BillHowell.ca:/> exit top >> exit didn't work? Next - finish upload to "billhowell.ca/QNial/MY_NDFS", but not with mput - instead with update command -> looks like I have to learn how to properly use mirror +-----+ https://unix.stackexchange.com/questions/93587/lftp-login-put-file-in-remote-dir-and-exit-in-a-single-command-proper-quoting lftp -e "put -O remote/dir/ /local/file.txt; bye" ftp.yourhost.com and put your credentials under ~/.netrc like machine ftp.yourhost.com login your_username password your_password Putting passwords in the cli is absolutely no-go since those are even readable when using ps -aux during the upload.. beside the bash history also. answered Aug 30 '17 at 7:50, Eugen Maye +-----+ https://serverfault.com/questions/220988/how-to-upload-a-directory-recursively-to-an-ftp-server-by-just-using-ftp-or-lftp lftp should be able to do this in one step, in particular with lftp mirror: EDIT: the lftp command syntax is confusing, original invocation I posted doesn't work. Try it like this: lftp -e "mirror -R {local dir} {remote dir}" -u {username},{password} {host} note the quotes around the arguments to the -e switch. shareimprove this answer edited Mar 13 '17 at 13:55 jorisw 33 answered Jan 11 '11 at 7:05 Phil Hollenback ... Finally got the answer!!! Create shell script ftpmirror.sh #!/bin/bash path = /local-dir-path lftp -e "mirror -R $path /$path" -u username,password ftp-server-ip Path = local directory which we want to copy into ftp server username = ftp server user name password = ftp server password ftp-server-ip = IP address of ftp server If lftp package is not installed the installed it using yum. edited Mar 19 at 11:15 Nicolas Raoul answered Mar 17 at 6:21 Kiran Zinjurde +-----+ nlist [args] List remote file names .. ls params List remote files. You can redirect output of this command to file or via pipe to external command. By default, ls output is cached, to see new listing use rels or cache flush. .. Site names can be used in the open command directly as-is or in any command that accepts input URLs using the bm:site/path format. add [] add current place or given location to bookmarks and bind to given name del remove bookmark with name edit start editor on bookmarks file import import foreign bookmarks list list bookmarks (default) +-----+ mirror [OPTS] [source [target]] Mirror specified source directory to local target directory. If the target directory ends with a slash (except the root), the source base name is appended to target directory name. Source and/or target can be URLs pointing to directories. -c, --continue continue a mirror job if possible -e, --delete delete files not present at remote site --delete-first delete old files before transferring new ones --depth-first descend into subdirectories before transferring files -s, --allow-suid set suid/sgid bits according to remote site --allow-chown try to set owner and group on files --ascii use ascii mode transfers (implies --ignore-size) --ignore-time ignore time when deciding whether to download --ignore-size ignore size when deciding whether to download --only-missing download only missing files --only-existing download only files already existing at target -n, --only-newer download only newer files (-c won't work) --no-empty-dirs don't create empty directories (implies --depth-first) -r, --no-recursion don't go to subdirectories --no-symlinks don't create symbolic links -p, --no-perms don't set file permissions --no-umask don't apply umask to file modes -R, --reverse reverse mirror (put files) -L, --dereference download symbolic links as files -N, --newer-than=SPEC download only files newer than specified time --older-than=SPEC download only files older than specified time --size-range=RANGE download only files with size in specified range -P, --parallel[=N] download N files in parallel --use-pget[-n=N] use pget to transfer every single file --on-change=CMD execute the command if anything has been changed --loop repeat mirror until no changes found -i RX, --include=RX include matching files -x RX, --exclude=RX exclude matching files -I GP, --include-glob=GP include matching files -X GP, --exclude-glob=GP exclude matching files -f FILE, --file=FILE mirror a single file or globbed group (e.g. /path/to/*.txt) -O DIR, --target-directory=DIR target base path or URL -v, --verbose[=level] verbose operation --log=FILE write lftp commands being executed to FILE --script=FILE write lftp commands to FILE, but don't execute them --just-print, --dry-run same as --script=- --max-errors=N stop after this number of errors --skip-noaccess don't try to transfer files with no read access. --use-cache use cached directory listings --Remove-source-files remove files after transfer (use with caution) -a same as --allow-chown --allow-suid --no-umask mkdir [-p] [-f] dir(s) Make remote directories. If -p is used, make all components of paths. The -f option makes mkdir quiet and suppresses messages. rm [-r] [-f] files Remove remote files. Does not expand wildcards, use mrm for that. -r is for recursive directory remove. Be careful, if something goes wrong you can lose files. -f suppress error messages. rmdir dir(s) Remove remote directories. When using -R, the source directory is local and the target is remote. If the target directory is omitted, base name of the source directory is used. If both directories are omitted, current local and remote directories are used. If the target directory ends with a slash (except the root directory) then base name of the source directory is appended. +-----+ open [-e cmd] [-u user[,pass]] [-p port] host|url Select a FTP server. +-----+ close [-a] Close idle connections. By default only with the current server, use -a to close all idle connections. +-----+ put [-E] [-a] [-c] [-O base] lfile [-o rfile] Upload lfile with remote name rfile. If -o omitted, the base name of lfile is used as remote name. Does not expand wildcards, use mput for that. -o specifies remote file name (default - basename of lfile) -c continue, reput. It requires permission to overwrite remote files -E delete source files after successful transfer (dangerous) -a use ascii mode (binary is the default) -O specifies base directory or URL where files should be placed +-----+ mput [-c] [-d] [-a] [-E] [-O base] files Upload files with wildcard expansion. By default it uses the base name of local name as remote one. This can be changed by `-d' option. -c continue, reput -d create directories the same as in file names and put the files into them instead of cur‐ rent directory -E delete source files after successful transfer (dangerous) -a use ascii mode (binary is the default) -O specifies base directory or URL where files should be placed +-----+ mkdir [-p] [-f] dir(s) Make remote directories. If -p is used, make all components of paths. The -f option makes mkdir quiet and suppresses messages. +-----+ exit [bg] [top] [parent] [kill] [code] exit will exit from lftp or move to background if there are active jobs. If no job is active, code is passed to operating system as lftp's termination status. If code is omitted, the exit code of last command is used. `exit bg' forces moving to background when cmd:move-background is false. `exit top' makes top level `shell' (internal lftp command executor) terminate. `exit parent' terminates the parent shell when running a nested script. `exit kill' kills all numbered jobs before exiting. The options can be combined, e.g. `at 08:00 -- exit top kill &' kills all jobs and makes lftp exit at specified time. 08********08 #] 10Sep2018 lftp man docs https://linux.die.net/man/1/lftp better man page ? => nfor this! Commands ! shell command Launch shell or shell command. !ls To do a directory listing of the local host. close [-a] Close idle connections. By default only with the current server, use -a to close all idle connections. exit [bg] [top] [parent] [kill] [code] exit will exit from lftp or move to background if there are active jobs. If no job is active, code is passed to operating system as lftp's termination status. If code is omitted, the exit code of last command is used. `exit bg' forces moving to background when cmd:move-background is false. `exit top' makes top level `shell' (internal lftp command executor) terminate. `exit parent' terminates the parent shell when running a nested script. `exit kill' kills all numbered jobs before exiting. The options can be combined, e.g. `at 08:00 -- exit top kill &' kills all jobs and makes lftp exit at specified time. rm [-r] [-f] files Remove remote files. Does not expand wildcards, use mrm for that. -r is for recursive directory remove. Becareful, if something goes wrong you can lose files. -f suppress error messages. rmdir dir(s) Remove remote directories. source file source -e command Execute commands recorded in file file or returned by specified external command. source ~/.lftp/rc source -e echo help # $ bash "$d_SysMaint"'internet & wifi/lftp notes.txt' # enddoc