- GETTING STARTED
- GUIDES
- COMMANDS
- Server connection
- File Transfer
- Directory operations
- File operations
- Script output
- Miscellaneous
- OTHER
ADDEXCLUSION
Add files to the exclusion list. Use this command to have ScriptFTP ignore a set of files when transferring data.
Syntax: ADDEXCLUSION(list,filename,path)
- list: ScriptFTP maintains two exclusion lists: one for uploads and another one for downloads. Use this parameter to indicate which list you want to add the file to.
UPLOAD Select the upload exclusion list. DOWNLOAD Select the download exclusion list. - filename: local or remote filename (depending on the list you have selected). Wildcards are also supported. Do not include any path in this parameter, only file names.
- path (optional): local or remote path to the file you want to exclude. The path must be a full path, for example C:\Docs\Whatever\ or /remote_dir/whatever/. If you do not supply this parameter ScriptFTP will ignore all files matching the given file name regardless of their path.
Return value:
This command will return "OK" unless wrong parameters are supplied.
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.
See also:
SYNC
GETFILE
PUTFILE
CLEAREXCLUSION
Examples:
# Connect to ftp.myftp.com
OPENHOST("ftp.myftp.com","myuser","mypassword")
# Download
# Do not download tmp files, ignore the directory cgi-bin
ADDEXCLUSION(DOWNLOAD,"*.tmp")
ADDEXCLUSION(DOWNLOAD,"cgi-bin/")
LOCALCHDIR("C:\dest_dir\")
GETFILE("*.*",SUBDIRS)
# Upload
# Do not upload the backup directory, ignore all
# jpg files in C:\mydir\photos
LOCALCHDIR("c:\mydir")
ADDEXCLUSION(UPLOAD,"backup\")
ADDEXCLUSION(UPLOAD,"*.jpg","C:\mydir\photos")
PUTFILE("*.*",SUBDIRS)
CLOSEHOST
OPENHOST("ftp.myserver.com","myuser","123456")
# Download all files and directories in /d/server
# apart from all files (not directories) in /d/server/temp
ADDEXCLUSION(DOWNLOAD,"*.*","/d/server/temp")
GETFILE("/d/server/*.*",SUBDIRS)
CLOSEHOST()

