Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: XMD5 and Net::FTP

by flexvault (Monsignor)
on Oct 14, 2014 at 11:06 UTC ( [id://1103712]=note: print w/replies, xml ) Need Help??


in reply to XMD5 and Net::FTP

james28909,

I think you have your answer about using MD5 stamps, but you are adding a lot of CPU work to find out that a file has changed ( or not ) and you are not guaranteed that the MD5 will be different. A few years ago, I took 400K files and did MD5 of each file and then sorted the results. I found that many different files had the exact same MD5. MD5 is great for determining that 2 files are the same, but not necessarily that they are different. YMMV.

To get the results I needed, I used the 'find' command with the '-newer' option to build my list of files to backup. Immediately after the 'find', I would 'touch' a file for getting my base target for the next 'find' cycle. Unfortunately, depending on long the 'find' took to execute, sometimes I would miss a file, and so I changed the file timestamp to exactly the same time that the 'find' started each cycle.

Just giving you some thoughts before you finish your design. Also look at 'rsync' for some ideas. Good Luck!

Regards...Ed

"Well done is better than well said." - Benjamin Franklin

Replies are listed 'Best First'.
Re^2: XMD5 and Net::FTP
by james28909 (Deacon) on Oct 15, 2014 at 08:34 UTC
    well actually i am having a bit of another problem in which i have never had to deal with to much. i am recursively traversing directories in "$ENV{USERPROFILE}\\Files_to_sync\\". or in other words i am scanning all directories and sub directories for files in this directory. but i am having problems only uploading the files in sub directories inwhich it is wanting to upload C:/Users/username/Files to sync/folder/another folder/file.txt for example. i just want it to upload folder/another folder/file.txt.

    i have setup a regex that strips the beginning of the path off to exactly what i need, but then i am having problems with file not found. is there a way to upload only what i am asking? or am i overlooking something simple. I can however upload single files from the "files to upload" folder, but i cannot upload empty subdirectories or sub directories with files ect ect.

    can you give me an idea of what i need to do? because it seems like cwd is going to do the exact same thing i am trying to do which is return the exact cwd, but then somehow i got to upload only files and directories and sub directories in "files to upload" folder.

    and thanks for the insight. i will def look into other methods as soon as i can understand this little predicament i am in. i have no problems building a fils/directories list and pushing it to an array, the problem comes in when i try to upload the regexed path/filename.

      james28909,

      I'm not that up on Windows. *nix is my bag, so if no one else answers you, just ask this specific question as a new topic. Please also include the OS and version. While Perl is everywhere, how it interacts with the operating system may be very different.

      And again, Good Luck!

      Regards...Ed

      "Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1103712]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-28 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found