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
:) 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
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
-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 ;)