Examples: Directory Transfers

You can use wildcards and tokens to perform different directory transfers.

  1. To receive all the files in a directory folder, you can use a wildcard on the command line. For example:

    cfrecv LocalFileName:’/home/johndoe/data/$(RemoteFileName)’ RemoteFileName:’/mftps/data/*’ n:MFTNode

    As a result of this example, all files with the same file names in the /mftps/data/ directory are received.

    You can also use the special * token in place of the $(RemoteFileName) token:

    cfrecv LocalFileName:’/home/johndoe/data/*’ RemoteFileName:’/mftps/data/*’

  2. To send the files in the subdirectories for a directory transfer, you can set ScanSubDir to Y on the command line. For example:

    cfsend ScanSubDir:Y n:PhoenixNode LocalFileName:/home/johndoe/data/* RemoteFileName’/mftps/data/\$(LocalFileName)

    As a result of this example, all files and subdirectories in the /home/johndoe/data directory are sent.

    You can also use the special * token in place of the $(LocalFileName) token:

    cfsend ScanSubDir:Y n:PhoenixNode LocalFileName:/home/johndoe/data/* RemoteFileName’/mftps/data/*

  3. To receive a directory and also duplicate the directory structure from the remote system, you can use the $(SDIR) token:

    cfrecv ScanSubDir:Y LocalFileName:’/home/johndoe/data/$(SDIR)/$(RemoteFileName)’ RemoteFileName:’/mftps/data/*’ n:MontrealNode

    As a result of this example, all files and subdirectories in the /mftps/data/ directory are received with the same structure.