Suddenly some of my files are blank

I believe that your project was downloaded, yes, but unless you actively monitored all files inside the project (who does that?), some of them could have been moved away by macOS without you even realizing it. And this “local emptiness” then could even spread to Scrivener’s backups. At that point you’re at the mercy of your Time Machine* backups (they should work even if no Scrivener backups existed at all).

(*even if the backup medium is not connected, Time Machine stores local copies in that case)

1 Like

The project is 1.7 MB. That 1.7 MB was downloaded.

Your empty files disagree.

1 Like

Well, 1.7 MB shows as downloaded. If Mac OS is moving random pieces of an entire downloaded package on and off the drive then even the “keep downloaded” setting wouldn’t necessarily help. In any case, I have used Scrivener with iCloud for years without issues (even when I had far less storage space than I do now). I am trying to figure out why I had an issue now and more important to see if there is any way to recover my blank files.

But that’s the whole point of this setting. As far as macOS is concerned, it sees “a folder”. If it doesn’t assume “keep everything in that folder downloaded” (when told to do so), that would be a huge bug.

That’s the real miracle in this case. Given the circumstances (Scrivener project “in the cloud”, “Optimize Storage” enabled, turning off the computer without closing Scrivener / no useful backups, etc.). I can’t tell you “why now”, but I guarantee you it will happen again. And I don’t want that to happen.

Have you already looked into the Time Machine backups? As I said, even if you had no backup drive connected during that time, TM will continue working every hour locally. Worst case would be there are just the daily backups left after some time, but better than nothing.

1 Like

Oh I didn’t know that about local snapshots. Unfortunately, it appears to only keep them for 24 hours so it’s already been too long.

Also, I never turn my computer off without closing Scrivener. I closed the lid for the night which puts the computer in sleep mode. Everyone time the computer is shut down or restarted it automatically closes out of Scrivener.

Yes, I would assume so too. And at the time this happened, that folder showed as downloaded in the Finder. If it or part of it had been in the Cloud, the Finder would have shown that.

Support calls I’ve reviewed at Apple have had to resolve issues exactly like that. Partial syncs of nested folders for various reasons that appear to be completely synced. The complexity of the Scrivener project package would make that even more possible. I don’t recall reviewing any Scrivener specific cases so couldn’t comment beyond that.

2 Likes

You’re right about the snapshots. I was hoping it also keeps a daily one locally (as long as there’s enough space), but apparently not. Damn.

That’s like saying: “I never drive my car off the cliff… I just let it roll, than it hangs in the air for a couple of seconds and boom, car stops.” :see_no_evil:

Even if Scrivener shuts down gracefully and is able to finish its backup, there may be loosely associated tasks that don’t finish in time (e.g. cloud sync).

It just doesn’t keep sleeping (unless you disable “Power Nap”), it does all kinds of stuff, like… Optimizing Mac Storage. Worst case in this instance: Scrivener goes to sleep with all files available and wakes up with some files not available anymore.

What RuffPub said in the post above. You put a lot of unwarranted trust in one of Apple’s most “unmagic” inventions.

1 Like

When I restart my computer it automatically clicks the “quit Scrivener” command just as I do when I quit manually. (If it can’t quit an application, the restart fails). So I’m not sure what you’re suggesting I do?

You quit Scrivener, get yourself a nice cup of tea and then shut down the computer. I don’t think macOS waits for iCloud, and Scrivener certainly doesn’t, ever. (That also applies to Dropbox, btw.)

Sleep mode does not close Scrivener (or anything else). It suspends all tasks instantly. Scrivener doesn’t save, automatic backups don’t run, cloud services don’t sync. It is not the same as a true shutdown. It’s not intended to be: the whole point of Sleep mode is to bring you back to whatever you were doing as soon as the computer wakes up.

1 Like

Yes, I know sleep mode doesn’t quit anything. What I was talking about above is when I restart my computer, which I typically do a couple of times a week. That closes out of all apps (and if they won’t close properly it cancels the restart). The two most recent times I did that it does not seem to have triggered a back up.

That’s separate from what happened when the data disappeared - at that point my computer was in sleep mode.

Thanks for the advice, though that’s sadly not always practicable (time to make a nice cup of tea is generally in short supply in my life :-). For what it’s worth, when it quits Scrivener it says it is indexing. However now at least my project is set to stay downloaded no matter what.

Actually I’m pretty sure I do know exactly when the files went blank because my total project word count changed and my daily project target went up. That’s how I knew something was wrong. Even now when I open a copy based on the back up from right after the files disappeared, it thinks the files are there and then when I try to open them the total project word count goes down. That’s also the back up that shows text from those files in the finder preview.

The opposite may have caused this problem: “Optimization”. I’m pretty sure that’s one of the services that do run during Sleep, or rather the “light sleep” phases during Sleep when macOS is busy with housecleaning (unless “Power Nap” is turned off).

If macOS decides to move files from a project that’s still open in Scrivener (assuming Scrivener was active before the lid went down), something like that might happen:

And next time you backup (either manually or when quitting the program) you get some nice blank files in your backup. Not good.

I’d say you’re on the right track. Also never skip the daily Time Machine backups. Quit Scrivener or force it to backup before you close the lid. Losing work is way more inconvenient than losing a couple of seconds.

And you don’t have a copy from the day before that happened? That sucks. :confused:

No, that’s the weird thing combined with the blank files. For some reason in the two weeks before the blank files it did not create backups even when though I quit a couple of times. i’m now compiling and exporting every night. That’s really fast and feels way safer.

Sometimes the small holes in the Swiss cheese perfectly align and not so small bad things happen. Kind of a perfect example.

Good. You may also consider:

this way a backup is always just a S away. (If you’re in the habit of doing this often, it’s a good idea to uncheck the Only keep option and remove old backups manually from time to time).

ADD: One more thing to consider (in general), if I’m not completely mistaken, the files macOS “optimizes away” are not included in Time Maschine backups. Maybe their placeholders, but not the data.

Yes, I have the “only keep option” on. It was set to 5 but on advice received in this thread I have it set to 25. And I did change my settings to back up with each manual save. But honestly I’m much more comfortable with a non-Scrivener text back up at this point. Because Scrivener has not been backing up when it is supposed to according to my settings. It’s a great program but what I need for a back up is the text. Easy enough to paste the text back in if it is lost. And no optimized away files are not in Time Machine bakcups. But they are in iCloud. Which, btw, saved me when I lost my computer in a fire last spring.

Sorry about the fire. iCloud, as a sync service, is not a robust backup. Files lost on the local copy (which you seem to have happened) are lost in the cloud “copy”. Use the 3-2-1 backup regime. And turn off your macOS disk optimisation.

1 Like