# FTP

#### and schedule FTP batch jobs

Syntax:

• list: ScriptFTP keeps two exclusion lists: one for uploads (with local files that are excluded from uploading) and another one for downloads (with remote files that are excluded when downloading). Use this parameter to indicate which list you want to add the file to. Allowed values for this parameter are:
 LOCAL Use this one to select the local exclusion list. This list stores local files that will be excluded when uploading. REMOTE Use this one to select the remote exclusion list. This list stores remote files that will be excluded when downloading.
• filename_or_directory: the name of the filename or directory to exclude. If it is a directory put a / or \ at the end of the name. It can optionally include the path of the file or directory you want to exclude. The path must be a full path, for example “C:\Docs\Whatever.txt” or “/remote_dir/whatever/”. If you do not supply a path ScriptFTP will ignore all files or directories matching the name regardless of their path. For example “file.zip” will exclude any file named “file.zip” regardless of its location in the folder tree

Remarks:

• This command is capable of ignoring directories as well. Use “/” or “\” at the end of the file name to indicate that it is a directory. See the examples.
• This command supports wildcards. You can use a wildcard expression in the file name parameter, for example: “*.JPG” for ignoring all jpeg files. Note that file names on FTP servers are usually case sensitive; for example, *.jpg and *.JPG refer to different file extensions.

Examples:

# ignore any .exe file when downloading, regardless on its location

# ignore any exe file under /testing/joe_results/*.exe

# regardless on its location in the folder tree

# regardless of its location in the folder tree

# ignore the folder named "backup" under /123/abc/

# ignore any folder which name starts with "New folder"

GETFILE("*.*",SUBDIRS)
# ignore any .exe file when downloading

# ignore any directory named "testing" under the user desktop

# ignore any zip file under the user desktop\testing2 directory

# This will return an error. If paths are used locally, they must
# be absolute
ADDEXCLUSION(LOCAL,"Desktop\test2\testing2\*.zip")
# Connect to ftp.myftp.com

LOCALCHDIR("C:\dest_dir\")
GETFILE("*.*",SUBDIRS)

# Do not upload the backup directory, ignore all
# jpg files in C:\mydir\photos
LOCALCHDIR("c:\mydir")
PUTFILE("*.*",SUBDIRS)

CLOSEHOST
OPENHOST("ftp.myserver.com","myuser","123456")

# apart from all files (not directories) in /d/server/temp
GETFILE("/d/server/*.*",SUBDIRS)
CLOSEHOST()

Return values:

OK: The command was successfully run.
18001: The path parameter cannot be empty.
18002: Wildcards are only allowed in the file name or directory name. Not in the path.
18003: The path parameter cannot be empty
18004: Wildcards are only allowed in the file name or directory name. Not in the path.
18005: If a local path is used it must be absolute. For example: C:\foo\bar\ or \foo\bar. Try also excluding only the file or directory name, without a path
18011: The filename or directory name cannot include a path. Indicate it using the additional optional parameter.
18012: The remote path cannot contain \\ . Use the / character as directory separator
18021: The filename or dirname cannot include a path. Indicate it using the additional optional parameter.
18022: The local path cannot contain / . Use the \\ character as directory separator
Any other error code corresponds to a Windows error code

Command History:

From ScriptFTP version 4.1 this command has changed its syntax. The third parameter (path) has been deprecated for simplicity.