Files related to Scrivener project found in OS X Trash

Every now and then I’ll check in the OS X Trash and find a whole bunch of files related to the book I am currently writing with Scrivener and needless to say this is quite unnerving…

The project folder is normally stored in my DropBox folder, which contains the Scrivener project file along with all the associated images, videos and research. When I check in the OS X trash I will find the project folder with a random selection of items relating to this project, but when I check in the DropBox folder everything is still there.

At a certain point without emptying the trash I’ll find those items have disappeared and I’ve never lost any data to the best of my knowledge but I do find this rather strange and just a bit scary after a year of work to see this going on. More to the point I never see it happen with any other files, so one way or another I think Scrivener may be involved.

I just checked the Get Info on the Scrivener project file that is currently in the trash, which shows it was last modified on the 12th of August 2012, so this is obviously an older version. I originally thought this may be down to Time Machine, but I ended up wiping that drive with zeros and starting fresh just a couple months ago.

As mentioned before I don’t think I’ve ever lost any data as such but something doesn’t seem right and I don’t see this with projects done in Freeway etc. Does anybody know what is going on here?

I can’t think of anything on either the vanilla OS (including Time Machine which won’t ever move anything around on the drive it backs up—the only time it manipulates the target drive is when you ask it to replace or restore files) or within Scrivener that would cause pieces of a project to be moved or copied to the Trash folder. The most likely suspects in my opinion would be any maintenance or clean-up scripts, and potentially general-purpose automation like Hazel. Dropbox shouldn’t be the culprit here. When things are deleted from the Dropbox folder they are simply removed, not moved to the Trash.

I’m not using any maintenance scripts beyond what the basic OS might run if the computer is still running at night and I’d never even heard of Hazel before. I checked an hour or two later and those files were simply gone from the trash, even though I hadn’t manually deleted them. A few jpeg files I had added previously still remained so it’s a real mystery.

It’s basically like looking at a snapshot of the project folder including all the contents from a few months before that appears without warning in the trash then disappears a few hours later. It’s only ever happening though with this Scrivener project stored in DropBox. This is my first Scrivener project so I can’t tell you anything more precise and it’s not even something you see every day. Just every now and then.

What happens to backups when they exceed the limit set in Preferences > Backup…?

The oldest ones should be deleted from the Time Machine backup but I still have around 100 gigs of free space on that drive. My entire Scrivener project folder is only around 2 gigs.

I think Hugh was referencing the Scrivener setting “Only keep X most recent backup files”, which will delete the oldest backup when it creates a new one, once it bumps up against this limit. It’s possible that when the automatic backup is triggered, the oldest backup is dumped into the OS X trash… but I’m pretty sure it would look like a project file, not the individual, internal files of a project.

Ah right that makes sense but in this case it is the entire folder containing the Scrivener file and all related content such as PDF files, videos and images. It just happens to always be an old version and invariably sends me to the DropBox folder in panic.

Yes, I think it would be the entire Scrivener project folder, because that is what would have been backed up (and a Scrivener “file” is of course a project folder containing many files). Out of interest, what is your setting in Scrivener > Preferences > Backup for the limit on backups to be held at any one time? Five? And do your Scrivener project folder backups, wherever you keep them, resemble what’s being placed in the System Trash? (If your backups reaching their limit is the explanation for what you’re seeing, it cannot however explain - for me - why they’re subsequently being deleted from the Trash while nothing else is…)

I don’t have access to the Mac right now but I used to have 5 backups until recently when I decided to increase that to the maximum allowable, which was 25 from memory. I figured that since I’ve been working on this book for over a year I need as many safeguards as possible.

The Scrivener backups are stored as compressed .Zip archives, whereas the folder appearing in the trash is uncompressed just like it appears inside DropBox, but an older version.

On a side note my wife recently spent two days editing a video using iMovie that suddenly crashed after she dropped in some text from a Word Doc. When it restarted the entire project had disappeared without a trace and since it was stored on a different hard drive there was no recent backup from the last few hours using Time Machine. I’ve never had to deal with a scenario like this but I was able to recoup the project file using Crashplan and it brought home just how fragile our data can be if things go wrong. I was glad it worked in this case and hope I never have to make use of it with my Scrivener projects.

Old automatic backups are not moved to the Trash, so that’s not the vector (and besides as you point out one is zipped and the other isn’t).

That’s very weird that they disappeared from the Trash without your emptying it. The question is where are these old projects coming from in the first place? They can’t just materialise out of thin bytes. If you use Spotlight to search the drive for the project name, do you come up with anything other than the expected stuff in Dropbox (and potentially the backups)?

There isn’t much to be gleaned from the 'net about a problem like this. I came across one forum thread about mysterious files appearing in the Trash on reboot, but they were garbage 0-byte files and potentially related to a corrupted Boot Camp partition—that doesn’t match these symptoms.

I just had a look with spotlight for the specific Scrivener project file and all it showed was the main file in DropBox and a copy on the connected Time Machine drive; in other words nothing strange or unexpected.

It’s always this folder with the relevant contents that I see in the trash and never anything else from other projects. I just tried checking Time Machine to see if I could locate that mysterious item but it won’t let you go back and check the trash for some reason.

This is something I have probably seen happen half a dozen times over the last few months and worried every time but nothing important has ever been lost as far as I can tell and it just comes and goes from the trash without any intervention on my part. I’ll keep an eye on it and try to find out more the next time it happens. It could well be that this is not specifically related to Scrivener in any way but I’ve never seen anything like this previously in 15 years of using Macs.

Yeah, that’s why utilities is what came to mind initially; this just isn’t behaviour that I would expect of a Mac and it isn’t anything Scrivener is programmed to do. Hazel, for instance, would be perfectly capable of moving old files to the Trash and then later deleting them automatically (it has a Trash pruning tool). But that’s obviously not the problem.

There is one potential source for clues, and that is the File/Put Back command. On a selected file in the trash, this will attempt to restore it to the location it came from. Unfortunately it doesn’t tell you where it came from when it does that, but a Spotlight search after doing that might reveal it. Knowing where this thing comes from would potentially be a valuable piece of information.

And on that note, the information for “Put Back” is stored in ~/.Trash/.DS_Store, but that’s a tough read even with a hex editor.

Could this be part of Dropbox’s maintenance routine? That is, what does Dropbox do with the old version of a file after a new version has been saved?

Because of the way Dropbox works, any change temporarily creates two versions of a file: the new version, resident on your computer, and the old version, resident in the cloud. Best practice would be to hold onto the cloud version until the local version uploads successfully, or vice versa if the cloud version is newer.

So my guess is that these files are appearing in the Trash as part of Dropbox’s post-sync cleanup. While I’m just speculating, it’s easy enough to test the hypothesis: create a simple RTF file in TextEdit. Upload to Dropbox. Make an edit to that file from a different computer, then see if re-syncing it to the original computer causes a copy to appear in the Trash.

Katherine

My Scrivener files had never been edited on a different computer until a couple days ago and that caused me a very nasty shock this morning when I suddenly found myself wondering where 50,000 words had gone missing. This was syncing via DropBox between Mac and Windows versions of Scrivener.

I’ve now managed to recoup the lost work thanks to backups and have it all back in place on the Mac but I won’t touch the Windows version again until this project is finished and locked down. I purchased the Windows version yesterday thinking it would allow me to work on the laptop but I don’t feel confident doing that at this stage.

This problem with files appearing in the trash could well be DropBox related but the last one I saw dated back many months ago and there must have been countless updates during that time to DropBox.

Ow. I’m sorry to hear your initial experience with the Windows version was poor.

If you plan to use Dropbox to share work between systems, you should read this thread, on best practices to avoid synchronization conflicts:
https://forum.literatureandlatte.com/t/using-scrivener-with-dropbox/11295/1

Sync conflicts are probably the number one cause of data loss-related support requests, but there are a few things you can do to dramatically reduce the risk.

Katherine

Hi Katherine,
I’ll definitely read that thread later on. I did actually drop an email to support on Friday before purchasing the Windows version to ask about this very issue and followed the mentioned guidance:

scrivener.tenderapp.com/help/kb/ … patibility

scrivener.tenderapp.com/help/kb/ … th-dropbox

I was able to get everything back by locating the last backup done using Windows and because I was feeling paranoid I copied the compressed backup onto a USB stick before transferring it to the Mac and copying it to DropBox from there. Now I’m back up to 56,000 words with nothing lost but I shall stick with the Mac version.

Something I found slightly awkward during the salvage operation is that the Mac version identifies the project folder as a single item like example.scriv, whereas I found myself dealing with elements within the .scriv file using Windows and it was all a bit confusing. I wondered if this is what was throwing the cross platform synchronisation. I’ve used DropBox for years and exchanged files between platforms without ever having an issue like this before.

That’s just an illusion on the Mac. In fact there are many things on your Mac that look like files but are in fact folders with a bunch of files in them. Likely every single program in your Applications folder is that way. It is just a feature of how things are displayed, not how they are. So if you copy such a thing to a computer that does not support notions like ‘packaging’, then you’ll see it for what it really is, a folder with a bunch of files in it. The Dropbox concerns are the same for both platforms, because they both use the same format and access it in similar ways.

But to reiterate, I don’t think this is a Dropbox problem. I’ve never heard of it moving files to the Trash, as it has its own deleted file mechanism for recovery that is cross-platform and accessible from any machine via their website. They would have no advantage in using the local machine’s recovery mechanism.