jonaswinkler / paperless-ng

A supercharged version of paperless: scan, index and archive all your physical documents
https://paperless-ng.readthedocs.io/en/latest/
GNU General Public License v3.0
5.37k stars 355 forks source link

Paperless-ng prevents hard drive sleeping #1589

Open Sithuk opened 2 years ago

Sithuk commented 2 years ago

I installed paperless using the bare metal method. It is installed in an ubuntu lxd container on hard drive A. I have my /paperless/consume /paperless/media and /paperless/data folders on hard drive B. I set hard drive B to sleep after 5 minutes of activity. Hard drive B will not sleep. Hard drive B does sleep if I move the /paperless/data folder to hard drive A.

Is paperless supposed to frequently poll the /paperless/data folder when I am not actively using paperless? Is this a bug or is this works as designed? Is there a way to stop paperless from keeping the drive awake that the /data folder is on?

DarrienG commented 2 years ago

FYI you shouldn't have your hard drive sleep. Waking it constantly lowers the lifespan of the drive: https://runyoncanyon-losangeles.com/popular-lifehacks/is-sleep-mode-bad-for-hard-drive/

Sithuk commented 2 years ago

DarrienG: The link you posted says there is no evidence that putting a drive to sleep harms the drive. Did you mean to post another link?

“ Is sleep mode bad for hard drive?

powering them down: There is no definitive research showing that hard drives which are powered off and on (whether it be sleep mode, turning the computer off, etc), suffer more damage than those running constantly. Hard drives consume the most power when turning on, and damage most commonly occurs when powering up.”

Are you able to say how to stop paperless-ng waking the drive with the /paperless/data folder on it?

a17t commented 2 years ago

hi @Sithuk ,

paperless ng uses either a local sqlite.db or postgresql.

In case you use a sqlite.db it is stored in the /data volume. To my knowledge, the sqlite database will be kept open constantly by paperless. That could be the reason for the disk staying active. Although if there is no activity in paperless, the disk might still be able to sleep.

The data directory also contains the logs, which contain any log entry written by paperless. So that might be the second candidate keeping the drive active. You could try pointing the logfile to a different drive with a symlink, or changing the configuration so nothing is logged or it has a different location.