Hat sich LFTP in DSM7 verändert? Muss backup von remote SFTP folder machen (ohne SSH key)

TimDetert

Benutzer
Mitglied seit
30. Aug 2022
Beiträge
2
Punkte für Reaktionen
0
Punkte
1
Hallo zusammen,

aktuell rufe ich mit einer DS720+ per Task-Schedule und schlankem "wGet" user script alle 5min kleine XMLs per FTP ab. Nach einem Firmware update der Quelle (Sortier Maschine mit Linux basis) wird mir nun nur noch SFTP angeboten. Macht in Sachen Security sicherlich Sinn ABER das ganze Netzwerk ist eh offline UND ich habe keine Chance SSH keys auf der Sortier-Maschine zu installieren...

Welche Möglichkeiten hab ich? RSYNC ohne SSH geht meine ich nicht... Ich hab mit LFTP rumgebastelt bin aber auch kein Script Experte (wobei das eigentlich einfach aussieht). Den Zugang hab ich mit FileZilla getestet (USER, PASSW, HOST, 22). Oder ist das zu komplex um direkt aus dem Task-Schedule Window ausgeführt zu werden. Performance ist ebenfalls keine Sorge wir reden von ca. 20 File je 2KB. Muss nur sauber und stetig laufen.

Gruß + Danke für Eure Hilfe

Skript unten:

  1. #!/bin/bash
  2. #login information for your remote host, no quotes
  3. login=xxxxx
  4. #password information for your remote host, no quotes
  5. pass=xxxxx
  6. #host info for your remote host. include full URL standard format is sftp://ftp.servername.com
  7. host=sftp://xxxxx.xxxxx.xxxxx
  8. #remote location where your finished downloads are on your seedbox
  9. remote_dir=/where/your/files/are/on/remote/host
  10. #local directory where you are storing your downloads for further processing
  11. local_dir=/where/you/want/the/files/to/go/locally

  12. # Runs the lftp to sync, please amend xxxxx to your ssh / sftp port if required or remove the -p xxxxx option altogether if desired.
  13. # command use-pget-n=20 uses 20 threads, command -P1 does one file at a time. Amend as needed keeping in mind not flooding your remote host with too many connections.
  14. # command --log=lftp_logs.log will write to the log location you specify, for troubleshooting. Remove if not needed.
  15. lftp -u $login,$pass $host -p xxxxx << EOF
  16. mirror --use-pget-n=20 -P1 -c --log=lftp_logs.log $remote_dir $local_dir
  17. quit
  18. EOF
 


 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat