Topic "Check file existence"

Author Message
thomasFrh
[View user's profile]

Joined: 2016-12-20
Posts: 2
Hello all,

I try to find out how I can check whether a file exists. If the file not exists I want to send an email (-> backup script):

Code:
winscp.com /log=log.log /ini=nul /command ^ "option batch abort" ^ "open ftp://test:test@localhost/" ^ "option failonnomatch on" ^ "ls test.sql" ^ "exit"

if %ERRORLEVEL% neq 0 goto error

:error
echo No file found -> email
pause
exit 1

echo test


My question is how I have to change the script, because of course "ls" does not run... Unfortunately it is not possible to download the file, because the files are very big..

Maybe someone can help me!

Thanks,
Thomas
Advertisements
thomasFrh
[View user's profile]

Joined: 2016-12-20
Posts: 2
Does anyone have an idea? I still tried a half day to find a way how to check whether the file exists... Sad
Makc666
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
https://winscp.net/eng/docs/scripting#commands

checksum
or
stat
?
Makc666
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
Here it is:
https://winscp.net/eng/docs/script_checking_file_existence#scripting
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License