#This script does an infinite loop and mantains a local dir always syncronized from a FTP site: host="172.16.0.4" user="carl" password="123456" openhost(host,user,password) chdir("remotedir/remotesubdir") localchdir("C:\localdir\") #do an infinite loop while("TRUE") result=sync("C:\local_dir","/myremotedir",DOWNLOAD) if(not(isequal(result,"OK"))) print("ERROR on SYNC, exiting") #exit with error code 1 sleep("10") exit("1") else print("All files downloaded. Waiting 10 seconds") sleep("10") end if end while