Files modified after some file's creation date

General discussion related to "Everything".
Post Reply
meteorquake
Posts: 523
Joined: Thu Dec 15, 2016 9:44 pm

Files modified after some file's creation date

Post by meteorquake »

I haven't used much of the special abilities the program has, hopefully I'll pick it up in time with usage.
I am wondering how to search for files that were modified after a specific file was created.
(Use case is quickly backing up my wife's laptop by 7z-ing the files changed since the last 7z of changes was made, with adhoc omissions, which I then copy onto my own computer.)
Cheers, David
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Files modified after some file's creation date

Post by void »

To find files/folders modified after a specific date/time:

dm:>=2023-01-25T201844

Date Syntax
dm:




To find files/folders modified after the date created of a specific file:

You'll need Everything 1.5.

dm:>=[get-date-created:"c:\windows\notepad.exe"]

where c:\windows\notepad.exe is the specific file.
[get-date-created:"c:\windows\notepad.exe"] is replaced with the date created of the specified file.

[get-date-created:]
meteorquake
Posts: 523
Joined: Thu Dec 15, 2016 9:44 pm

Re: Files modified after some file's creation date

Post by meteorquake »

Thank you void!

Is there actually a way to abstract it a bit more, so
"Files modified after the creation date of the latest-created 7z in a particular folder"
In other words, instead of specific file, an Everything sorted-search could be used ("7z files in a folder, latest at top") and the top item of that result picked off for its attribute (create date) that's then used as the value for the dm:>= ?

David
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Files modified after some file's creation date

Post by void »

The following will give you a list of all the latest created 7z files for each folder:

ext:7z sort:path;dc distinct:path



I'm not 100% sure what you are trying to do with this information.
Would you limit the dm: search to the folder and subfolders where the 7z file was located?



You would have to manually perform the dm: search for each 7z file:
  • Open a new Everything window and set the search to:
    dm:>=[get-date-created:clipboard:]
  • Back in the previous window with your 7z files, copy each file to the clipboard.
  • The other window will update in real-time showing files modified after the creation date of the 7z file in your clipboard.


Use the following search if you would like to limit the results to the folder or subfolder where the 7z file is located:

ancestor:[pathpart:clipboard:] dm:>=[get-date-created:clipboard:]



Unrelated:
:clipboard: in phpbb == :clipboard:
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Files modified after some file's creation date

Post by raccoon »

void wrote: Thu Jan 26, 2023 4:38 am I'm not 100% sure what you are trying to do with this information.
Would you limit the dm: search to the folder and subfolders where the 7z file was located?
He wants to get the dc: of the most recently created 7z archive of his wife's documents. Since each periodic archive will have a different filename, he cannot bookmark a search that utilizes the dc: of the most recent 7z for searching for new files the wife created since the previous archive was performed. So, he needs a way to replace the "notepad.exe" in your earlier example with "wife-files-[newest-dc:].7z" for his Everything bookmark.
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Files modified after some file's creation date

Post by void »

You would need to do a two-pass search:

First search for your wifes 7z backup files, eg:

"c:\backup\" *.7z sort:date-created



Copy the latest file to the clipboard and search for:

dm:>=[get-date-created:clipboard:]



Consider adding these as bookmarks Under Bookmarks -> Add to bookmarks....

Consider the following BAT file:

Code: Select all

FOR /F "tokens=* USEBACKQ" %%F IN (`es.exe "c:\backup\" *.7z -n 1 -sort dc`) DO (
SET latest7z=%%F
)
ECHO %latest7z%

es.exe dm:^>=[get-date-created:"%latest7z%"]
ES
meteorquake
Posts: 523
Joined: Thu Dec 15, 2016 9:44 pm

Re: Files modified after some file's creation date

Post by meteorquake »

Thanks void, and interesting use of the clipboard: concept.
So it seems it hasn't got subquery facility where it can pick off the top result of a search (perhaps a pre-calculating function with a search-string and field to return could do it).
I think as well as those suggestions a VBS script that scans the folder for the latest 7z and launches Everything with a search using the 7z it finds, or of course save each 7z mini-backup with the current TS but after copying always rename it to a fixed name for Everything to use for next time.
Many thanks, David
Post Reply