# Suggestions for scripting: health + photoprism scan

**URL:** https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660
**Category:** Apps
**Tags:** photoprism
**Created:** [27 June 2026 08:41 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660 "2026-06-27T08:41:35Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SimoneBuralli](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SimoneBuralli](https://syncloud.discourse.group/u/SimoneBuralli)
#### Post date: [27 June 2026 08:41 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/1 "2026-06-27T08:41:35Z")

</div>

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 😉

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

The contents:

```auto
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

 ![image](https://global.discourse-cdn.com/free1/uploads/syncloud/original/1X/d4bcf8f103bf1ce5153dc7c8ab84fa77f41c9e5e.png)

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [27 June 2026 17:52 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/2 "2026-06-27T17:52:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SimoneBuralli](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SimoneBuralli](https://syncloud.discourse.group/u/SimoneBuralli)
#### Post date: [1 July 2026 14:46 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/3 "2026-07-01T14:46:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [3 July 2026 06:36 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/4 "2026-07-03T06:36:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![SimoneBuralli](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SimoneBuralli](https://syncloud.discourse.group/u/SimoneBuralli)
#### Post date: [3 July 2026 16:55 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/5 "2026-07-03T16:55:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SimoneBuralli](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SimoneBuralli](https://syncloud.discourse.group/u/SimoneBuralli)
#### Post date: [3 July 2026 20:55 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/6 "2026-07-03T20:55:11Z")

</div>

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

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

```

Thanks

Simone

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [11 July 2026 00:20 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/7 "2026-07-11T00:20:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [11 July 2026 06:52 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/8 "2026-07-11T06:52:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SimoneBuralli](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SimoneBuralli](https://syncloud.discourse.group/u/SimoneBuralli)
#### Post date: [11 July 2026 15:50 UTC](https://syncloud.discourse.group/t/suggestions-for-scripting-health-photoprism-scan/660/9 "2026-07-11T15:50:26Z")

</div>

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 😃 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
