ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Sync folders by renaming files

<< < (5/6) > >>

f0dder:
It's good to have a checksum option, but i just checked a couple hundred .jpgs and videos and couldn't find a single pair of files that were exactly the same size, even pix taken within seconds of each other. i do have lots of videos too, and i'm afraid checksums would take a long time.-DyNama (June 03, 2013, 02:35 AM)
--- End quote ---
Unless you're going to check several gigabytes at a time, checksumming isn't too bad - even for several years old computers, the hashing speed will be I/O limited, even for hashes that are stronger than md5. A slightly sophisticated tool could hash source and destination files at the same time (given that they're on different physical media), which should be pretty fast.

OK, an USB2 enclosure will max out at ~25MB/s regardless of how fast the disk inside is, but even if you're processing a chunk of a couple of gigabytes, that's less than two minutes of extra processing, to be sure that things are going to be all in order. Two minutes might sound like a fair chunk of time, but how long is it going to take you to recreate the photos? - or, if nothing has been lost, just the time spent sorting out the mess? :)

4wd:
choice /c ny /m "View logfile"
--- End quote ---
is supposed to ask me if i want to view the log, it still doesn't. it echos a "goto" in the CMD window and then closes.-DyNama (June 05, 2013, 12:57 PM)
--- End quote ---

I modified v7 to add the quotes around everything referring to the log file - I normally avoid spaces in folder/file names so I rarely have this problem.

And the line before the choice command now refers to the full path for the log, (which I forgot).

Two minutes might sound like a fair chunk of time, but how long is it going to take you to recreate the photos? - or, if nothing has been lost, just the time spent sorting out the mess? :)
-f0dder (June 05, 2013, 05:33 PM)
--- End quote ---

I think the problem with this method regarding photos, is that the EXIF data can vary even between two photos taken at the same time, (ISO speed, etc), which throws off the checksum - if you could checksum just the image data, ignoring any EXIF/extras then it's certainly a viable option.

There's a example on stackoverflow of doing it using python, I might have a play and see what kind of mess I can come up with for a batch file :)

But you have a very valid point about the mucking up of names, even though a file can't be overwritten, (internal DOS ren command just fails) - so you won't lose files.

V8 Generates Undo cmd files in the form of Undo-YYYYMMDDHHMMSS.cmd in the batch file folder.

eg. Here's the log:

---------------------------
Thu 06/06/2013  14:57:24.40
---------------------------
Renamed: "fdv s fds 89ds fdg fd78g 6.jpg" To: "[email protected]"
 

--- End quote ---

Here's the Undo file, (Undo-20130606145946.cmd):
ren "U:\test\3 8\[email protected]" "fdv s fds 89ds fdg fd78g 6.jpg"

--- End quote ---

BTW, I'm just adding the latest version to my last posts and leaving the others there in case someone wants some earlier version to valmorphanize into something else.  If that's a problem, let me know and I'll delete all the previous.

DyNama:
OMG, this program keeps getting better! i never thot to ask for logging and undo files! works great! now there's less fear that i enter the source and destination folders backwards accidently.

4wd:
Probably the final version.

V9 Added choice between matching Date and Time or matching SHA-1 hash, requires FCIV mentioned above for SHA-1, (it will always match size obviously).
    Changed log output to name the Undo file for each run and match criteria.

eg.
---------------------------
Thu 06/06/2013  21:36:13.35
Matching: SHA-1 hash
Undo file: Undo-20130606213613.cmd
---------------------------
Renamed: "fdv s fds 89ds fdg fd78g 6.jpg" To: "[email protected]"
---------------------------
Thu 06/06/2013  21:36:55.53
Matching: Date and Time
Undo file: Undo-20130606213655.cmd
---------------------------
Renamed files: 0

--- End quote ---

If it says Renamed files: 0 then there won't be an Undo cmd file even though it lists one.

Broken the 3kB barrier, I suppose I could put in checking for the existence of fciv.exe in the path but maybe someone else wants to do it.

Addendum: Found a fault with v9 - still requires Delayed Expansion for doing the hash values.  I'm going to write a small SHA-1 program to avoid the for loop that causes this problem.  See v9.5 here.

DyNama:
4wd, i am satisfied. it's a very nice program, saves me a lot of time, and ensures i don't lose my file notes in a disk failure. i'm going to put a shortcut to it on my start menu.

i concede that checksum makes the file matching almost perfect, and programs should be robust enough to do the job and not make mistakes, but i'm happy enough with size + date most of the time identifying distinct and unique files without making me wait. even on an i5 core computer, i appreciate tasks being fast enough so i don't get distracted. i may never notice files renamed wrongly as these are just the backups. now i'll have the logs too, and i will keep them―for some reason i've kept activity logs from my computers since 2004! i even upload them to the cloud!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version