Suggestions for scripting: health + photoprism scan

Hi Boris,
Syncloud Health works GREAT and to me it is a crucial feature. I would like to create a script like the following one - I beg you pardon for the “non-shell-like” language. Here follows the idea :wink:

The call to the script: my_script[scan_options;kill_time]

The contents:

execute photoprism_scan [scan_options];
if photoprism_web.killtime < [kill_time] 
    then
            execute photoprism_scan [scan_options];
    else
            {
             execute photoprism_clean;
             printout "completed successfully";
            }

Do you think it is doable or additional developments on your side are required? On the Photoprism side, I think that photoprism.cli offers all the required commands. Here follows an example of an item in the stability events list.

Thanks a lot

Simone

Could you explain what is the problem you are trying to fix?

hi Boris,
here follows what I usually do to scan my media in Photoprism, PTP from now on. Being that it is an iterative process, I’m thinking to a script. I’m looking forward to receiving your opinion.
Here is the process:

  1. I start the media scan in PTP (important: “complete rescan” is unchecked);
  2. I open Syncloud Health;
  3. every 10-20 minutes I check that Health has not killed the process “photoprism.web”;
  4. if the process is running, I do nothing;
  5. if the process has been killed, I start the media scan in PTP once again.

Being that I do not perform a complete rescan, every time the process goes ahead and scans new media. If I spend few hours a week in doing this (while I do other things!!!), I can complete the scan in a couple of months.

Thx

Simone

Let’s try few system level things before that.
Just pushed a fix for memory swap, can you upgrade from settings updates, then send the error report when photoprism is killed again (it may survive with swap).
Then I have a nother potential fix, I think we can make photoprism not die.

1 Like

Hi,
for sure the stability is now amazing compared to the previous version. I have started the process 30 m ago and it is still running. It never happened before.
In case I get a message about a killed process, I’ll share the logs. Thanks a lot

Simone

1 Like

Hi Boris,
to stress the system, I have started a scan on a huge folder and…it just happened :smiley: : killed process. I have sent you the logs.

process terminated (SIGTERM)
23m ago
photoprism.web (ld.so)

Thanks

Simone

Ok another fix as planned is coming tomorrow. I will reduce 4 workers to 2 , which will make scans longer but more stable

New version is published (v296), please update and check the big scan.

Hi Boris,
being that I completed the scan few days ago, I have started a “complete rescan” on the entire library.
Here follow the achievemnts after the upgrade:

  1. the scan process was started 80 minutes ago and is stil running. It never happened before, very good!
  2. in order to stress the system a little further I have also tried a scan with the option “AI generated labels” active. In that case the proces is killed after 30 seconds :smiley: But, as you know, AI options in Photoprism are for systems that are more powerful than mine!

Conclusion: it seems like that in a well configured Phptoprism according to the system that one user owns, the scan process is no more a problem of stability for Photprism itself or the entire system. To me this makes Photoprism usable with no doubts.
Thanks a lot

Simone