Backup fails for sign out

cu
cunum
Posts: 2
Joined: Mon Sep 21, 2020 1:55 pm
Platform: Mac + Windows

Mon Sep 21, 2020 2:00 pm Post

When signing out, Scrivener presents the following screen:

"Scrivener is set to back up on project close but the backup could not be created. This could be because the backup location is inaccessible or there is insufficient space. Automatic backup preferences can be adjusted in Options or Project Settings. Continue closing without backing up?"

Steps to reproduce:

- Press Ctrl + Alt + Del
- Click Sign Out
- The Prompt should appear

BC
BClarke
Posts: 94
Joined: Sun Mar 29, 2020 10:58 pm
Platform: Windows
Location: Longmont, CO, USA

Mon Sep 21, 2020 6:30 pm Post

Are you backing up to a cloud location? If so, that could be the cause.

When you press Ctrl-Alt-Del and tell Windows to shut down/sign out, it starts with the user processes in order of their shutdown level, an integer between 0 and 1023, with the default being 640 (most applications use the default). If the process servicing the cloud location gets shut down before Scrivener, the cloud location may not be available for saving the backup.

Online
st
steveshank
Posts: 408
Joined: Tue Mar 07, 2017 8:28 pm
Platform: Windows

Mon Sep 21, 2020 11:54 pm Post

cunum wrote:When signing out, Scrivener presents the following screen:

"Scrivener is set to back up on project close but the backup could not be created. This could be because the backup location is inaccessible or there is insufficient space. Automatic backup preferences can be adjusted in Options or Project Settings. Continue closing without backing up?"

Steps to reproduce:

- Press Ctrl + Alt + Del
- Click Sign Out
- The Prompt should appear


You will have much less trouble if you close your programs before signing out of your computer and expecting Windows to clean up after you.

cu
cunum
Posts: 2
Joined: Mon Sep 21, 2020 1:55 pm
Platform: Mac + Windows

Wed Oct 07, 2020 3:30 pm Post

BClarke wrote:Are you backing up to a cloud location? If so, that could be the cause.

When you press Ctrl-Alt-Del and tell Windows to shut down/sign out, it starts with the user processes in order of their shutdown level, an integer between 0 and 1023, with the default being 640 (most applications use the default). If the process servicing the cloud location gets shut down before Scrivener, the cloud location may not be available for saving the backup.


No only local, no cloud backup configured.

You will have much less trouble if you close your programs before signing out of your computer and expecting Windows to clean up after you.


Guys, this is a beta test, I know you shouldn't do it like this, but Scrivener should be able to handle such user actions in a safe manner, especially when it's about backups. Scrivener shouldn't lose any data just because Windows is updating automatically and signing you out for example (this is how it occured for me the first time), these are edge cases that need to adressed.

User avatar
devinganger
Posts: 2639
Joined: Sat Nov 06, 2010 1:55 pm
Platform: Mac, Win + iOS
Location: Monroe, WA 98272
Contact:

Wed Oct 07, 2020 4:40 pm Post

cunum wrote:
You will have much less trouble if you close your programs before signing out of your computer and expecting Windows to clean up after you.


Guys, this is a beta test, I know you shouldn't do it like this, but Scrivener should be able to handle such user actions in a safe manner, especially when it's about backups. Scrivener shouldn't lose any data just because Windows is updating automatically and signing you out for example (this is how it occured for me the first time), these are edge cases that need to adressed.


How much data do you have in your project? Do you have a lot of large research materials imported in?

One thing you can do is manually back up your Scrivener project and time how long it takes. What Scrivener is actually doing is writing a copy of every data file in your project to a new location. If you have a large amount of data in your project, that is naturally going to take a certain amount of time -- and that time will be longer if the working copy of your project and the backup copy are on the same disk (the OS has to alternate between reading and writing from the same source -- if that source is a spinning platter disk drive you get the additional overhead of the read/write head having to swap back and forth between the various block locations, which takes far longer than the actual reads/writes themselves.) If you are performing a ZIP on your backup, then it also has to go through the backup files, add them to the ZIP, and clean up after itself. All of this takes a certain amount of time dictated by physics and the underlying OS.

Windows only gives processes a certain amount of time to respond to the shutdown signal. If the time your project backup takes is longer than that window...WIndows will terminate Scrivener before it completes the backup.

Note that this can happen even on smaller projects, if you have a number of processes that are all being shut down at once and contending for disk access at the same time (such as writing logs, writing events to the Event Viewer, etc.)

The best practice for Scrivener is to shut your projects down when you are done working, not just leave it open. They even include a setting where Scrivener will automatically shut itself down after a certain period of inactivity. They also provide ways to reference external documents in your project Binder without including those files in your project folder, which is perfect for reducing project/backups size (and thus time) -- files that are large reference files that you're not going to be editing from Scrivener are a perfect candidate for linking like this (video files, PDFs, etc.)

Scrivener tries to be smart, but it can't override the OS and it can't handle every edge case directly. Programs and users still have to work within the parameters defined by the laws of physics and the operating system.
--
Devin L. Ganger
Not a L&L employee; opinions are those of my cat
Life has a way of moving you past wants and hopes -- Kevin Flynn

ch
chrisdr2
Posts: 80
Joined: Wed Oct 16, 2019 9:09 am
Platform: Windows

Wed Oct 07, 2020 6:54 pm Post

devinganger wrote:
cunum wrote:
You will have much less trouble if you close your programs before signing out of your computer and expecting Windows to clean up after you.


Guys, this is a beta test, I know you shouldn't do it like this, but Scrivener should be able to handle such user actions in a safe manner, especially when it's about backups. Scrivener shouldn't lose any data just because Windows is updating automatically and signing you out for example (this is how it occured for me the first time), these are edge cases that need to adressed.


How much data do you have in your project? Do you have a lot of large research materials imported in?

One thing you can do is manually back up your Scrivener project and time how long it takes. What Scrivener is actually doing is writing a copy of every data file in your project to a new location. If you have a large amount of data in your project, that is naturally going to take a certain amount of time -- and that time will be longer if the working copy of your project and the backup copy are on the same disk (the OS has to alternate between reading and writing from the same source -- if that source is a spinning platter disk drive you get the additional overhead of the read/write head having to swap back and forth between the various block locations, which takes far longer than the actual reads/writes themselves.) If you are performing a ZIP on your backup, then it also has to go through the backup files, add them to the ZIP, and clean up after itself. All of this takes a certain amount of time dictated by physics and the underlying OS.

Windows only gives processes a certain amount of time to respond to the shutdown signal. If the time your project backup takes is longer than that window...WIndows will terminate Scrivener before it completes the backup.

Note that this can happen even on smaller projects, if you have a number of processes that are all being shut down at once and contending for disk access at the same time (such as writing logs, writing events to the Event Viewer, etc.)

The best practice for Scrivener is to shut your projects down when you are done working, not just leave it open. They even include a setting where Scrivener will automatically shut itself down after a certain period of inactivity. They also provide ways to reference external documents in your project Binder without including those files in your project folder, which is perfect for reducing project/backups size (and thus time) -- files that are large reference files that you're not going to be editing from Scrivener are a perfect candidate for linking like this (video files, PDFs, etc.)

Scrivener tries to be smart, but it can't override the OS and it can't handle every edge case directly. Programs and users still have to work within the parameters defined by the laws of physics and the operating system.


Agree that it is best practice to close everything before shutdown. There are certain conditions, like unsaved documents, that prevent Windows from shutting down (unless you press Shutdown Anyway). I've not done Windows programming for a long while, but I'd imagine that Scrivener's backup process could be protected from termination in a similar way..