Writing code to sync all files from directory A to directory B, anyone done this already in CF?

Posted on 2004-11-09
Last Modified: 2013-12-24
I am starting code to allow variable folders to be named, and have a program sync all folders and files from 1 directory to another in windows 2003 / ColdFusion MX.  Anyone have something like this already?  I have a feeling that coding for N levels of sub-folders is going to be tricky...
Question by:JUSTICE
    LVL 5

    Expert Comment

    i haven't done this.. but logically, it seems simple enough

    if you are using CF MX (6.0) then create a CFC that does the checking of each file within one directory with no further subdirectories... then waht you need to do is code another section that goes recursively through each directory and runs your CFC..that's a very basic approach to it.... dont know if u have already thought of that... just trying to contribue as much as i can for now
    LVL 1

    Author Comment

    I think my additional issue is this:  The data is all 30 - 80K .tiff images, and the folder I need to sync up has (right now) 12 sub-folders, each of which has up to 30 - 40 sub-folders of their own, each containing thousands of .tiff images.  Right now I am sitting at about 6 gigs of images, and growing by about 25 - 30 megs each day.  I need to find a way to only copy the images that have not been copied over, because I will soon not be able to sync the whole folder each night!  
    LVL 17

    Accepted Solution

    how are the images put into their folders?

    And why not use robocopy?
    or xxcopy

    they do a pretty good job, its free and if you really want to you can call it with cfexecute
    LVL 17

    Expert Comment

    To finish what I started, if the files are put into their folders through CF you can do an insert of the file details in the db , and flag the ones who have not been sync'd yet.. But I would recommend to use any of the above tools.
    LVL 1

    Author Comment

    Yea, I have good ole x-copy running in the background right now w/ archive bit.  That will do the trick.  ;)


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now