I'm not sure if this is even possible, but it would be nice to be able to SYNC a series of folders within a directory by inserting a wildcard (*) into a remote directory folder name.
Example:
-KLHT Management
Example:
Code: Select all
Just wondering... $myftpserver="ftp.abc.org"
$myuser="abc_user"
$mypassword="abc"
OPENHOST($myftpserver,$myuser,$mypassword)
# The remote folder directories have a wildcard in them
# that would allow to SYNC all folders with "Sept...2008", "Oct...2008" in their foldernames
SYNC("\downloads\abc","/storage/abc/Week_of_Sept*2008/",DOWNLOAD_DELETE,"abc*2008.mp3")
SYNC("\downloads\abc","/storage/abc/Week_of_Oct*2008/",DOWNLOAD_DELETE,"abc*2008.mp3")
CLOSEHOST()
EXIT
-KLHT Management
Hello,
I think that you can do it using FOREACH:
I think that you can do it using FOREACH:
Code: Select all
Does this script do what you mean?OPENHOST("127.0.0.1","carl","123456")
# Change current local and remote current directories
LOCALCHDIR("D:\Desktop\test\downloads\abc")
CHDIR("/storage/abc/")
# Get the remote file listing
GETLIST($remote_dir_list,REMOTE_DIRECTORIES,"Week_of_Sept*2008")
FOREACH $remote_dir IN $remote_dir_list
# Create a local directory with the same name. It may already exists...
LOCALMKDIR($remote_dir)
# Synchronize local directory from the FTP server
SYNC("D:\Desktop\test\downloads\abc\".$remote_dir,"/storage/abc/".$remote_dir,DOWNLOAD_DELETE,"abc*2008.mp3")
END FOREACH
CLOSEHOST
liked Script FTP? Try our other product Email Parser