I would like to create a Windows task, run every day at 11.00 am. It has to:
- connect by SFTP to a distant Ubuntu server
- download a full repertory (all its files AND all its sub-repertories except two of them)
To use PSFTP, I have already created a [backup.bat] file:
Code: Select all
@echo off
set $dir="D:\dokeos\batchbackupauto\"
pushd %$dir%
psftp.exe
And I've created a second file [ftpcommands.scr] :
Code: Select all
open [thehostname] 222
# [login]
# [password]
lcd D:\dokeos\backup\front\test
cd /home/thedistantrepertory
mget *.*
bye
=> Two questions:
1) In [backup.bat], how to tell to psftp.exe that it has to read the [ftpcommands.scr] file?
2) In [ftpcommands.scr] file, about the "mget" command, how to precise that it has to download all files AND all the sub-repertories?
Thanks in advance
