Question sftp to remote server

2
0
NAS
ds819j (x8)
Operating system
  1. Windows
I have multiple DS218j nas devices behind a firewall. I have a script that currently runs on all the nas devices to ftp .tif images to a server located behind same firewall. I do not have access to the server other than sending images. They are going to update to using sftp to receive these images. I am in need of help on a script to send these images via sftp using a password and user name. Any help would be greatly appreciated. My current script is:

#!/bin/ash
chmod +x FTP.sh
PATH=/opt/bin:/opt/sbin:$PATH
SOURCE=/volume1/documents/tiffs
BACKUPDIR=/documents/
lftp -u user,password 10.0.0.5 << EOF
mirror -R -n -I *.tif -I *.tif -X Collage/ -X ‘whatever/’ -X .piccache/ -X .recent/ -X Originals/ -X *.Db -X ‘@eaDir/’ $SOURCE $BACKUPDIR/
quit
 
I don't know if it allowed here or not, but I would reward for the first answer that works and can run in a script.
 
Last edited:
I'm not familiar with lftp but see it's one of the DSM command line utilities.

lftp home page LFTP - sophisticated file transfer program and here you'll find the LFTP - the manual page

Reading the blurb it says that lftp support SFTP. You can test how lftp selects and uses SFTP by enabling the DSM SFTP service and trying to connect to it on the local machine. Looks to be configuration settings according to the man page, provided Synology build lftp with SFTP suppport.

BTW I assume you just put the start of the ash script and that the 'EOF' line to end lftp's inserted here doc is later in your script. Also later you'll 'source' or '.' the FTP.sh script to run it, or something.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Hello, Is it possible on the synology NAS to use SFTP and get notifications/logs if someone has opened or...
Replies
0
Views
872

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top