Along with Dropbox's Packrat I have a Batch file that I have scheduled to request to run on Mon, Wed and Friday to backup my current project's Photoshop, Fireworks and PHP/WWW files onto a server.
The command is along the lines of:
PAUSE
set "myDate=%date:~6,4% %date:~3,2% %date:~0,2%"
set "myDateNoSpaces=%date:~6,4%%date:~3,2%%date:~0,2%"
mkdir "\\Server\Archive\%myDate%"
copy "A:\File.psd" "\\Server\Archive\%myDate%\File%myDateNoSpaces%.psd"
robocopy "A:\WAMP\www" "\\Server\Archive\%myDate%\www" /MIR
The command does not run regularly, on days where no work has been done on this project i simply close the window rather than pressing a button at the PAUSE prommpt. I also manually run the batch command. This creates an irregular pattern of dates backed up. The PST file is 500MB.
EG:
2014 07 15 <DIR>
2014 07 18 <DIR>
2014 07 22 <DIR>
2014 07 23 <DIR>
2014 07 28 <DIR>
2014 07 30 <DIR>
Within ...\2014 07 20\ we find a folder and a file:
www <DIR>
485,435,343 File20140720.pst
What I want to do:
I would like to compare the current PST's size and modified date with the most recently backed up one within the backup date folders before copying. I dont care about checking the WWW files, they change a lot but I rarely edit the PST and its 500MB.
I just dont know how to find the most recent folder when the directory names vary randomly.
I would prefer to use a CMD/DOS, Python or PHP solution rather than a backup application.
TDLR: How do I compare a file to the most recent file of the same type that has a different name in child directories of random names