Blazerboy777 Posted December 1, 2011 Share Posted December 1, 2011 Im not new with autioit or scripting, i am a novice, but like i said iv been around the block but need some help. I just purchased a laptop, connected it to my network, got everything running. Now what I want is to have my Folder be copied over from Network Drive. How do i explain better, or let me just show you what I tried to do in DOS, however it doesnt work probably incorrect syntax. Copy H:\ to C:\Users\Chris\Desktop\Business_Backup And I also want one that does the exact opposite so it would be Copy C:\Users\Chris\Desktop\Business_Backup To H:\ The purpose of the script is to update the files to and from on the fly when I update files on my workstation or laptop. In other words, If i scan 200 documents on my workstation (H) and they go to the designated (H) folder, I can jump on my laptop run the script to copy all 200 from H to my Business_Backup Folder, and when Im on business, and update files on the go, or create new files in the folder, I come home flip the script and have all the files I had on my laptop backed up to my workstations folder. Link to comment Share on other sites More sharing options...
Tonnie Posted December 1, 2011 Share Posted December 1, 2011 You can use the DirCopy function.For reference on this function see:http://www.autoitscript.com/autoit3/docs/functions/DirCopy.htm Link to comment Share on other sites More sharing options...
Blazerboy777 Posted December 1, 2011 Author Share Posted December 1, 2011 (edited) A simple one liner script that I have figured DirCopy ( H: , C:UsersChrisDesktopBusiness Backup, 1) It aint workin for me haha Edit: DirCopy ( "H:" , "C:UsersChrisDesktopBusiness_Backup", 0) is working but only if the directory "Business Backup has not been created. Now I could change the flag to 1 to overwrite and it would constantly work, but it would drag the process out much longer than just simply updating non-existing files in all subdirectories. Itd be a difference of about 10 gbs on average lol Edited December 1, 2011 by Blazerboy777 Link to comment Share on other sites More sharing options...
Tonnie Posted December 1, 2011 Share Posted December 1, 2011 I see, in that case the function FileCopy might be better suited. For reference:http://www.autoitscript.com/autoit3/docs/functions/FileCopy.htmMaybe try:FileCopy("H:*.*", "C:UsersChrisDesktopBusiness_Backup", 8) ; 8 = do not overwrite files, but create target directory if it doesn't exist Link to comment Share on other sites More sharing options...
Blazerboy777 Posted December 1, 2011 Author Share Posted December 1, 2011 Hm I am just going to leave it as is for now, as filecopy wont work. The problem would be in turn that it wouldnt know which files to designate as "Overwrite" because I edited them on the go, so maybe Overwriting all the files will have to suffice for now. Or maybe overwrite all files that have been edited in the last 7 days? The rest leave alone? Would make is so files that I dont touch, maybe I access them for viewing purposes, such as past receipts and transactions for verification purposes would not be overwritten, yet the ones that I had made that day would be overwrite the old files, or create anew if not currently there. Also, is there a way I can make like a "confirm button" To make sure I dont overwrite the wrong way and lose my data, like a "Confirm Button" and ill search up on how to make a progress bar as well, that would come in handy as well. Very much so. Link to comment Share on other sites More sharing options...
Blazerboy777 Posted December 1, 2011 Author Share Posted December 1, 2011 (edited) My network is running @ just about 4 megabytes a second transfer ratings, blame my retarded 2wire router not having'n' capabilites, but well anyways what I wanted to say is that at that speed, I tried to transfer a 1gb file over just for kicks and giggles and it took forever. So im wondering if there is any possible way that as I stated before, overwrite all existing files onto drive (Destination Directory) if originaldirectory has edited files in the past 5 days?Meaning if i edit a file on my laptop, create an mpeg, and download an mp3 and say read a downloaded book, and well edited a file like 2 months ago, when i go to sync up my folders, it only takes the file i edited, not the book because I only viewed it, but it will also copy over the video and the mp3 but nothing else.Basically stating the rule would be Overwrite from Original to Destination any files edited, created, or downloaded in the past 7 days, the rest pass over no overwrite.What i want is more of a "Sync" than a total overwrite if you know what I mean.EditLike I said this might not even be possible or might be so inefficient that it would be pointless to bother, but I mean if it worked like I think it would, then Im sure you can see the benefits from it, especially when the files may be over 10 gbs in total size.Or Any help/ tips are so very welcome. Edited December 1, 2011 by Blazerboy777 Link to comment Share on other sites More sharing options...
Tonnie Posted December 1, 2011 Share Posted December 1, 2011 The function FileGetTime might be usefull if you're trying to implement a sync function. However, with all the functionality you'd like to have with regards to synchronising files, I can't help but feel maybe you shouldn't use AutoIT for this problem (shocking, I know). There are probably lots of different free sync tools available for download that can do everything you're asking and more. Link to comment Share on other sites More sharing options...
Blazerboy777 Posted December 1, 2011 Author Share Posted December 1, 2011 Hm thats an idea, I didnt think of that, I just hate bloatware. I hate installing programs just to delete them later. And I like the idea of having a given just 2 clicks boom done kind of thing. You are right though thinking about it, but for now I will run with what Iv made. If i need it later I guess I will try finding a sync tool, would make it easier on everyone. Thanks for all your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now