benners Posted May 12, 2017 Share Posted May 12, 2017 No probs. I'll have a look and try to figure out the problem Link to comment Share on other sites More sharing options...
benners Posted May 12, 2017 Share Posted May 12, 2017 Try this. Added a simple file size check if the copy was interrupted and the file already exists. Swapped a bit of code round to write the list of folders to the ini before the main copy starts and not before the individual folder copy starts Benners Backup.au3 Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 12, 2017 Author Share Posted May 12, 2017 Hi Benners, First of all thanks for helping on this project...really appreciate it !! I tried your code but seems some cross check is still missing from it. Code does not continue where we left still as it gives error while copying from where we left, i have gathered screenshot ...please go through it once I tried to stop script at copying firefox folder and attached are the results. backup tool.docx Link to comment Share on other sites More sharing options...
benners Posted May 12, 2017 Share Posted May 12, 2017 (edited) I tried before I posted the script and had no problems. My process is, Run program Select backup location (folder on another drive D:\Test\Normal) Run backup Select another folder (folder on another drive D:\Test\Stopped) Open task manager Run backup and terminate the process tree using Task Manager Run Program Confirm resume operation When done use BeyondCompare to check both directories. No differences shown I have change the file copy to use _WinAPI, this might give a better indication of why the file copy fails. See updated script Edited May 12, 2017 by benners uploaded right file Link to comment Share on other sites More sharing options...
benners Posted May 12, 2017 Share Posted May 12, 2017 Benners Backup.au3 Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 13, 2017 Author Share Posted May 13, 2017 Thanks Benners Issue was with firefox ...seems it has to be killed before we start copying firefox profile...but no issues i added code into it and now its working. I also tried to compare files after copying and its seems to be good. One thing which seems i could not understand in that code is....about functionality of compressing files. As i said previously Whenever compress option is selected it should compress all folders somewhere in laptop temp path and compress it....then it should paste it in destination (i used 7zip in my code)... it was like backup.exe created. Please let me know if i misunderstood your code. Can you please check that too....thanksssss Link to comment Share on other sites More sharing options...
benners Posted May 13, 2017 Share Posted May 13, 2017 Yep, the compress code isn't finished. I was looking at ways of adding the files to an archive instead of copying, then adding, just to save some time. If your code for compressing is working then just use that. I will have a play and post here later Link to comment Share on other sites More sharing options...
benners Posted May 13, 2017 Share Posted May 13, 2017 Sorted the compression code. It's based on what you had in your original one, i.e it uses the same names\locations etc. The 7zip files are copied to a temp dir though. Benners Backup.au3 Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 14, 2017 Author Share Posted May 14, 2017 Thanks benners for the code Its my mistake....i could have brief more on it (compression code) See, currently all folders are being copied directly to destination folder when no compression is selected. Requirement is when compress option is selected then there should not be any folder copied to destination folder it should only copy "Backup.exe" to destination folder, backup.exe is the compressed version of source data we selected. All folders which were being copied on destination folder when compression option is not selected should first be copied in temp directory and compressed ...through compression we will get backup.exe and that backup.exe should be copied on destination folder. All folders which are in temp folders should be deleted after they are compressed and backup.exe is copied to destination folder. Please let me know if i missed something....i know i have become headache for you though Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 14, 2017 Author Share Posted May 14, 2017 All folders which were being copied on destination folder should first be copied in temp directory and compressed if compression mode is selected ...through compression we will get backup.exe and that backup.exe should be copied on destination folder. And yes this will be the last help for this code...thanks Link to comment Share on other sites More sharing options...
benners Posted May 14, 2017 Share Posted May 14, 2017 (edited) You aren't a headache. That's what this forum is for. People help if they want or have the time. You have provided feedback and code which is more than a lot do. Sometimes you'll see posts where people would rather ask a simple question and wait hours for a reply, than just try what they are asking. They are the ones I blacklist It won't be the last post, I'm sure. Once it's working you start to think, mmm I'll add more logging, try to improve speed, improve the code or coding when you see ways others have done it, so don't bother about asking. I have updated the script and commented the process. It now copies to a temp dir if compression is required and the backup.exe is saved in the destination dir. If you can learn from it like I have learned from others then it's not been a waste. Benners Backup.au3 Edited May 14, 2017 by benners Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 14, 2017 Author Share Posted May 14, 2017 12 hours ago, hiteshluthraauto said: Much Appreciated Sir, Thanks for understanding I tried code and its working as expected but seems while compressing its getting failed and not copying backup.exe (compress file) in destination dir...seems something is missing still. I am attaching backup.log file for clarity. Logically seems it correct but some miss in the code... I should undoubtedly appreciate that code to neat and improved a speed a lot if i compare it with my code. Seems i coded multiple logics and got failed somehow :)...got self puzzled. Backup.log Link to comment Share on other sites More sharing options...
benners Posted May 14, 2017 Share Posted May 14, 2017 (edited) Looking at the log. the 7zip files aren't being copied to the temp folder. You need to check they are in the Tools folder which should be in the same dir as the script. A successful backup log should be similar to the one below Backup.log I also noticed there is a 1 appearing in the temp file path C:\Users\ah0126953\AppData\Local\Temp\1\7zip Don't know how that's getting there if the code is still Local $s_7zip = @TempDir & '\7zip' Edited May 14, 2017 by benners Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 15, 2017 Author Share Posted May 15, 2017 Thanks Benners, I sorted that one with your clue given, and its now working if i do backup and do not interrupt script But seems one thing is missing still....lets say i have selected compress backup and in between i stopped script...then when i reopen script and click yes to continue where i left it starts copying pending folders to destination dir rather then continue saving it in temp dir and then compress it and creating backup.exe file...then copy to destination folder. Also it does not start compressing it. I am attaching steps and hope it helps here to understand. Seems loop problem here. Steps.docx Link to comment Share on other sites More sharing options...
benners Posted May 15, 2017 Share Posted May 15, 2017 Be a couple of days before I get to it. Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 16, 2017 Author Share Posted May 16, 2017 Sure benners Link to comment Share on other sites More sharing options...
benners Posted May 17, 2017 Share Posted May 17, 2017 This should do it Benners Backup.au3 Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 17, 2017 Author Share Posted May 17, 2017 sorry benners, But when i now trying with updated code (shared by you), then it just shows "Backup completed" popup and do not copy anything Link to comment Share on other sites More sharing options...
benners Posted May 17, 2017 Share Posted May 17, 2017 DOH!, that's my bad. I left a Return on line 150 after the code below. I used it when testing other parts. Remove that and it will work INI_Update('BackupRunning', 1) Link to comment Share on other sites More sharing options...
hiteshluthraauto Posted May 17, 2017 Author Share Posted May 17, 2017 Its worked !!! yes it worked according to requirement....and i see lot to learn from it. Many Many thanks benners for your seamless help !! Please let me know how can i help this forum ...would feel great if i can by any means. 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