0% found this document useful (0 votes)
7 views1 page

File Zilla Script

This document is a batch script for automating file transfers using FileZilla FTP Client. It sets up variables for local and remote directories, creates a log file, and attempts to transfer files while logging the process. If the transfer is successful, it deletes the local files; otherwise, it logs the failure without deleting any files.

Uploaded by

devendar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

File Zilla Script

This document is a batch script for automating file transfers using FileZilla FTP Client. It sets up variables for local and remote directories, creates a log file, and attempts to transfer files while logging the process. If the transfer is successful, it deletes the local files; otherwise, it logs the failure without deleting any files.

Uploaded by

devendar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

@echo off

setlocal

REM Define variables


set FileZillaPath="C:\Program Files\FileZilla FTP Client\filezilla.exe"
set LocalDirectory="D:\Naik\DD\TargetDirectory"
set RemoteDirectory="/test/"
set SiteName="YourSiteName" REM Replace with the name you gave the site in Site
Manager

REM Create log file


set LogFilePath="D:\Naik\DD\TransferLogs\filezilla_transfer_log.txt"

REM Create log directory if it does not exist


if not exist "D:\Naik\DD\TransferLogs" mkdir "D:\Naik\DD\TransferLogs"

REM Start FileZilla in command line mode


echo Starting file transfer...

REM Use the FileZilla command line options to transfer files


%FileZillaPath% --site=%SiteName% --local="%LocalDirectory%\*" --
remote="%RemoteDirectory%" >> %LogFilePath% 2>&1

REM Check if transfer was successful


if %errorlevel%==0 (
echo File transfer successful. Deleting local files... >> %LogFilePath%
del "%LocalDirectory%\*" >> %LogFilePath% 2>&1
if %errorlevel%==0 (
echo All files deleted from local directory. >> %LogFilePath%
) else (
echo Error deleting files: %errorlevel% >> %LogFilePath%
)
) else (
echo File transfer failed. No files were deleted. >> %LogFilePath%
)

pause

You might also like