this post was submitted on 13 Jan 2026
12 points (100.0% liked)

Linux Questions

3317 readers
19 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS
 

Last year I bought an M-Disc drive and a bunch of M-Discs and burnt all my files in Nextcloud to them as a backup.

It's a new year, I want to take any files added or modified in 2025 to burn a new disc.

I can work out how to get all files with a modified date in 2025, the problem is that if a file was moved into Nextcloud but wasn't changed, the modified date doesn't change. So I will miss files that someone has moved into Nextcloud without changing if the modified date is before 2025.

I can't use created date as literally all the files have a created date 1 Jan 2025 or later as the created date is when they synced from the server.

Normally I'd rsync to find changes but the current copy is spread across like 10 M-Discs, and reading each of those 100GB discs at CD reading speeds is going to be painful.

Does anyone have a better idea?

Edit: In case anyone is finding this later, I didn't get a better plan other than planning ahead. I copied each disc onto my hard drive (into a folder "Old replica"), copied the current state into a different directory ("New replica"), and ran Czkawka to remove files from "New replica" that are duplicates of files in "Old replica". And also used the Czkawka setting to delete empty directories once I deleted all those files.

What was left in "New replica" I burnt to disc, then Rsynced these back into the "Old replica" which I have for now left on my hard drive. Maybe if I run out of space I'll consider saving hashes or something for comparing, but for now this is just an extra copy I am storing because I didn't find a better way ๐Ÿคท

top 5 comments
sorted by: hot top controversial new old
[โ€“] itsathursday@lemmy.world 3 points 2 weeks ago (1 children)

Does nextcloud keep logs at all?

[โ€“] Dave@lemmy.nz 2 points 2 weeks ago* (last edited 2 weeks ago)

Hmm it does, but it seems it's only recording WARN level and above, if you were thinking of using it to track newly added files.

The file upload date is apparently in the database but there is a certain point where the CD thing becomes the easier option.

[โ€“] deadbeef79000@lemmy.nz 3 points 2 weeks ago (1 children)

Use stat on a known file and check if it has a birth or change (metadata) or modify (content) date that matches the expected time frame. You might be lucky and find that one of them matches.

Though if there is a database available, that seems like a good option to query (he says, ignorant of whatever NC's DB looks like)

[โ€“] Dave@lemmy.nz 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Oooh interesting, thanks! So, no created date is listed, and birth matches what it shows in the UI for created date, so is that the same thing?

But I notice there are options 'change' and 'modify'. Just before running this I moved the file into a different directory to test, and it seems the 'modify' date stayed the same, but 'change' got updated!

Access: 2026-01-11 20:27:56.158679457 +1300
Modify: 2025-07-01 12:34:00.702371789 +1200
Change: 2026-01-14 08:56:55.395383204 +1300
 Birth: 2025-12-02 16:13:25.779311070 +1300

I will have a go at working out how to identify files based on this change date, thanks for the tip!

I'm also not sure about Nextcloud's DB, though I think it's a relational postgress DB so it's probably possibly to get the data I want from it relatively easily. But I'd much prefer a file system option if I can. I need this to be easily repeatable each year.

Edit: Ah shit, all of the files have a change date in 2025. Damn. I will have to look at the database and see what it looks like.

[โ€“] Dave@lemmy.nz 1 points 2 weeks ago

I've had a play in the database. I can find the files and folder structure, then there are version timestamps which are probably what I'm looking for. But marrying these up to actual files for copying is going to be messy. At this point I think I'm just going to spent the days copying data off disks into a record of the last archive, then keep this on disk for next year. Or once I have a reconstructed archive, I might be able to build an index from it.

I didn't really think about this when burning the original discs (other than "that's a problem for future Dave"), so I have folders plopped on discs that are not in the same structure as in Nextcloud, as I spread things around to get them to fit. Once I reconstruct a proper version and get up to date, I can probably build some sort of index for next time where if a file has changed or it's not in my index, then include it.