Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

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

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...
0
JUSTICE
Asked:
JUSTICE
  • 2
  • 2
1 Solution
 
kkhippleCommented:
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
0
 
JUSTICEAuthor Commented:
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!  
0
 
Tacobell777Commented:
how are the images put into their folders?

And why not use robocopy? http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
or xxcopy http://www.xxcopy.com/index.htm

they do a pretty good job, its free and if you really want to you can call it with cfexecute
0
 
Tacobell777Commented:
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.
0
 
JUSTICEAuthor Commented:
Yea, I have good ole x-copy running in the background right now w/ archive bit.  That will do the trick.  ;)

Thanks!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now