Query for external media (photos and videos outside of vault)

What I’m trying to do

I date all my photos (ex. “20220422_Photo-Name”) periodically and add them to my vault where they are automatically linked to their corresponding daily note with a query:

file:"20220422"

Initially this was working perfectly but with all the photos and videos accumulating over time the size of my vault is exponentially increasing. That makes it difficult and expensive to continue to regularly back up my vault to the cloud.

So now I’m looking for an alternative way to link these photos without having to add them to the vault.

Things I have tried

My idea is that I have a “Media” folder outside of my vault and then just query that folder instead of the vault. I tried stuff like:

file:"20220422"
path:"../Media"

and

LIST
FROM "../Media"
WHERE contains(file.name, "20220422")

but that doesn’t work like I hoped it would.

It looks like you’re using the DataView plugin. Did you check the documentation? I’d guess that querying external files isn’t supported, but I don’t use the plugin myself so I could be wrong.

You’re right, the second example is using Dataview but querying external files isn’t supported. Thanks for your input. So there must be a way to do this with the integrated query feature.

Oh, I see, the first one is using the file: search operator. I didn’t get that before.

The built-in search won’t see files outside of the vault, either.

You may be able to copy file paths from your OS’s file browser and paste them as links.


Are you planning to not back up the outside-the-vault files at all, or just backup locally?

Unfortunately, this doesn’t seem to work either

Right now it’s a little complicated. I have all my media in the cloud AND in Obsidian (for that daily note functionality) so basically it’s using double the space.
In addition to that I back up the vault to the cloud every month, so after a year I’ll basically use 12x the amount of storage needed.

Do you at least get a path you could use in a link?

Ah. I’d recommend using a backup system that stores things more efficiently. Here are easy instructions for local backups and some links for cloud backups.

What do you want to do with the files if you get to query them from inside the vaults? Or put another way, do you ever intend to embed them somehow?

The reason I’m asking is that even though most of the queries work inside the vault, you’re able to do javascript which searches outside of the vault. (Of course then it’ll “break” when not on the desktop having those folders, and so on, but then again… )

It could however in such a case be a little troublesome to embed the image, and you might need to do some trickery to get that going. Just listing files with various searches related to the file name, shouldn’t be too hard to do (if you know a little coding).

Like @CawlinTeffid mention briefly, there are different backup strategies. One of them is to do incremental backups. In a scheme such as yours that could mean that you do a full backup of everything once each year, and then throughout the year you just backup extra versions of files changed related to the full backup. This drastically improves the demand on storage for your backup.

Depending on how much you trust your backup media, the same scheme could also be extended to only do full backups not even every year, but maybe every 5th year or something like that. It’s always a cost vs risk assesment to be made with regards to backups, but having more than 2-3 copies (in different physical locations) of anything seems a little excessive for most needs, but YMMV.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.