Jump to content

Search the Community

Showing results for tags 'synchronize files'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello, for Production i must monitor and align 2 intranet folders, and do some operations when find changes. Normally use Xcopy with /D option, crete txt list of copied files, and do things. This time i can't use this method because file are HUGE. So i think to create a script that take some informations from source file, and create a fake file on destination. Create this quick and dirty AI script: local $PATH_source = "D:\xxx\01-original\" local $PATH_destination = "D:\xxx\02-copy\" Local $search = FileFindFirstFile("D:\xxx\01-original\c_*.tif") ; my files used first letter to differentiate While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop ;resetting flag $f_something_change = 0 ;find all SOURCE file info needed Local $source_t_modified = FileGetTime($PATH_source & $file, 0, 1) Local $source_t_created = FileGetTime($PATH_source & $file, 1, 1) Local $source_t_accesses = FileGetTime($PATH_source & $file, 2, 1) Local $source_f_attrib = FileGetAttrib($PATH_source & $file) ;if file not exist in DEST create FAKE one if NOT FileExists($PATH_destination & $file) then $file_destination = FileOpen($PATH_destination & $file, 10) FileClose($file_destination) FileSetAttrib($PATH_destination & $file, $source_f_attrib, 0) FileSetTime($PATH_destination & $file, $source_t_modified, 0, 0) FileSetTime($PATH_destination & $file, $source_t_created, 1, 0) FileSetTime($PATH_destination & $file, $source_t_accesses, 2, 0) Else ;IF file already exist... ;find all EXISTING file info needed $existing_t_modified = FileGetTime($PATH_destination & $file, 0, 1) $existing_t_created = FileGetTime($PATH_destination & $file, 1, 1) $existing_t_accesses = FileGetTime($PATH_destination & $file, 2, 1) $existing_f_attrib = FileGetAttrib($PATH_destination & $file) ;and compare with SOURCE file info IF $existing_t_modified <> $source_t_modified then $f_something_change = 1 IF $existing_t_created <> $source_t_created then $f_something_change = 1 IF $existing_t_accesses <> $source_t_accesses then $f_something_change = 1 IF $existing_f_attrib <> $source_f_attrib then $f_something_change = 1 ;if something change if $f_something_change = 1 Then ;overwrite destination with new FAKE file FileDelete($PATH_destination & $file) $file_destination = FileOpen($PATH_destination & $file, 10) FileClose($file_destination) FileSetAttrib($PATH_destination & $file, $source_f_attrib, 0) FileSetTime($PATH_destination & $file, $source_t_modified, 0, 0) FileSetTime($PATH_destination & $file, $source_t_created, 1, 0) FileSetTime($PATH_destination & $file, $source_t_accesses, 2, 0) EndIf endif FileClose($file) WEnd ; Close the search handle FileClose($search) Can you suggest if approach it's right, and adjust my dirty script? Thank you, m.
×
×
  • Create New...