DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Post New Requests Here => Topic started by: Webijou on April 05, 2006, 04:16 PM

Title: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Webijou on April 05, 2006, 04:16 PM
Hello everybody,

I have a rather hard time to save my documents on the other hard drive, an external disc. I have to manually find the folders which hold my new works (from original drive, let's say "C")  in Explorer and then copy them, because otherwise the system would just copy from the scratch. It would copy everything, if I would just highlight for copying the main folder and that would last hours, because they are big ones. Good would be to tell the system: copy "C:/" to e.g. "D:/" and then the sys would quickly find out what has changed and only copy the new files.

I have an FTP programm for instance, which absolutely notices the date/time of the file-version and asks me, whether I want to copy the already uploaded files. ("Newer version exists in the destination folder - do you want to copy it?") When I click "no to all" the programm just updates the files which have been changed since the last copy-process. Is that not wonderful?

Regrettably my system does not do this. Maybe someone knows whether there is a device already available for free? I have Windows XP installed on the C and plain folders on the D (no XP there).

Thank you for warming up your grey cells for me. (https://www.donationcoder.com/forum/esmileys/gen0/Medium/VICTORY.GIF)

Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: jgpaiva on April 05, 2006, 04:31 PM
Aren't you looking for an incremental backup program?
There's a DC's Pro-User Backup Guide (https://www.donationcoder.com/Reviews/Archive/BackUpGuide/index.html) which might probably have the answer for the questions you're asking.
Isn't that what you want?
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Gerome on April 05, 2006, 05:00 PM
Hello,

More than a long discuss, here's a script code that does the exact trick you want :)
Enjoy!

#Option Explicit
$AppType Console
' **********************************************************************
' // Source dir to Dest dir with CRC script
' // CRC changed? If Yes, then modified file will be replaced onto Dest
' // Author   : Gerome GUILLEMIN
' // Date     : 06th Of April 2006
' // Language : FBSL
' **********************************************************************
Dim $Src = "C:\Source\"
Dim $Dst = "D:\Backup\"
Dim $Joker = "*.*"

If FindFirst( Src & Joker ) <> "" Then
  CheckAndCopy ( Findfirst )
  While FindNext() <> ""
    CheckAndCopy( Findnext )
  Wend
End If
Pause

Sub CheckAndCopy(Byref $szFound)
  If szFound = "." OrElse szFound = ".." Then Exit Sub
  Dim %srcCRC = 0, %dstCRC = 0

  srcCRC = CheckSum(FileLoad(Src & szFound))
  If FileExist( Dst & szFound ) Then
    dstCRC = CheckSum(FileLoad(Dst & szFound))
  End If
  If (srcCRC = dstCRC) AndAlso dstCRC <> 0 Then Exit Sub
  ? "[CRC diff] Copying ", Src & szFound, " -> ", Dst & szFound

  CopyF( Src & szFound, Dst & szFound )
End Sub
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Webijou on April 05, 2006, 05:21 PM
Thank you jgpaiva, I have checked the site. It seems, that it is in fact a backup tool which I am looking for.

Gerome! You really made my day :-) Thank you very much for the code. The only problem is, that I do not know, what to do with it, since a little html and css and such are my only code-skills. Could you tell me, where I can put the code into? Only if it is not too time-consuming for you. 
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Gerome on April 05, 2006, 05:25 PM
Hi,

Thank you jgpaiva, I have checked the site. It seems, that it is in fact a backup tool which I am looking for.

Gerome! You really made my day :-) Thank you very much for the code. The only problem is, that I do not know, what to do with it, since a little html and css and such are my only code-skills. Could you tell me, where I can put the code into? Only if it is not too time-consuming for you. 

Either you can download FBSL there : http://gedd123.free.fr/FBSLv3.exe
Or either you can try the code i gave you by pasting there : http://gedd123.free.fr/studio

The 1st solution will install the full interpreter + compiler + editor + 525 pahe Help manual with tutorials
The 2nd solution will allow you to quick and blindly compile the script i gave you into a stand alone EXEcutable.

Both solutions are able to produce standalone EXEcutable and the memory footprint is around 2 Mb of RAM, that is to say not greedy at all onto our decent machines ;)
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: skrommel on April 05, 2006, 05:48 PM
 :) How about using XCOPY?

The following copies all changed files from C:\ to D:\, resetting the attribute, overwriting existing files and ignoring any errors. If you pipe it to a file you can use FIND to log the errors.

XCOPY /M /E /C /F /G /H /I /R /Y C:\ D:\

Skrommel
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Webijou on April 05, 2006, 06:03 PM
Thank you, Gerome, yet this is still too fancy code for me. I would need a very easy tool, really for non-programmers. Something quite ready-to-use. But my best wishes (btw) for your FBS- language! 

Hi Skrommel - is there something like a ready made programm which has this code included? I am talking about something like Drag King, e.g. This programm came to my computer, I opened it and it just did what I wanted, I did not have to make an exe for myself or so. Maybe my suggestion is just beyond the size of a "snack", I don't know. 
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: jgpaiva on April 05, 2006, 06:08 PM
:) How about using XCOPY?
;D ;D ;D Always with the perfect simple solution.
Nice one!

Thank you jgpaiva, I have checked the site. It seems, that it is in fact a backup tool which I am looking for.
I noticed that might have been the case. If you feel like searching, there are a few threads in the forum about backup tools, and i think there is even a review coming that will focus on backup tools explicitly (not exactly on a guide, like the link i posted before)
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: skrommel on April 05, 2006, 08:07 PM
 :) Just copy the XCOPY line into Notepad, and save it as "Backup.cmd" (including the quotation marks, or it will end up a text file). Now make a shortcut to it to put on your desktop and change the icon, and you're good to go. And maybe add it to Scheduler to have it run automatically every night.

Skrommel
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Gerome on April 06, 2006, 02:20 AM
Hello,

:) Just copy the XCOPY line into Notepad, and save it as "Backup.cmd" (including the quotation marks, or it will end up a text file). Now make a shortcut to it to put on your desktop and change the icon, and you're good to go. And maybe add it to Scheduler to have it run automatically every night.

Skrommel

Yes, but XPCOPY is not able to see IF the file has been REALLY updated aka NOT only the DATE but ALSO the inner contents!!!

BUT, if you want to use COPY and log it onto a living window, you can use Fbsl to execute and pipe in perfect sync :)

Dim %hEdit = Fbsl_control("edit", Me, "", 1, 0, 0, 160, 250, 0x50310084, 0)
 
  Fbsl_SetText( Me, "Copy..." )
  Resize(Me, 0, 0, 170, 280 ): Center(Me): Show(me)

  Dim $buf = StrPipe("CMD.EXE /C DIR c:\DDE\*.* | copy /Y /V c:\DDE\*.* d:\Temp\" )
  Fbsl_SetText( hEdit, buf )
  MsgBox( Me, "Operation completed!", "CHECK POINT", MB_ICONINFORMATION )

Begin Events
End Events

Enjoy ;)
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: skrommel on April 06, 2006, 11:02 AM
 :) I agree that XCOPY hardly is a (two way) sync tool, but as a quick backup tool it is all I have ever needed. And using /M it checks for and removes the ATTRIB, so it is fast too, only copying the files changed since the last backup.

Skrommel
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Webijou on April 06, 2006, 02:53 PM
Thank you all very much. Meanwhile I have found exactly what I was looking for, a slim program very good for my purposes. Done by Karen http://www.karenware.com/powertools/ptreplicator.asp
I like the program, it is free and easy to use, uncomplicated, does what one expects not less, not more. 

I wonder if it would be seen as presumptuous if I write a little one paragraph end-user "review" for her program? I am new here.

And I wonder as well, whether some programmers could maybe have some reservations against the concept of the site, especially if the coders are very restrictive concerning freeware projects or so? (https://www.donationcoder.com/forum/esmileys/gen0/Medium/DNTKNW.GIF)
So I do not know, yet would like to say thanks to Karen that way.

 

Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Carol Haynes on April 06, 2006, 03:05 PM
I wonder if it would be seen as presumptuous if I write a little one paragraph end-user "review" for her program? I am new here.

Not at all go for it!

Oh and welcome ...
Title: Re: IDEA: Some programm which is able to recognize newer versions when copying
Post by: Webijou on April 06, 2006, 03:21 PM

Not at all go for it!

Oh and welcome ...
-Carol Haynes (April 06, 2006, 03:05 PM)

Thank you, Carol!