letorbi / synoindexwatcher

An automated media index updater for Synology DiskStations.
GNU General Public License v3.0
68 stars 7 forks source link

Nothing happen after starting the script and adding new files #59

Open iostrym opened 8 months ago

iostrym commented 8 months ago

Hello,

Using DSM6:

I launch manually the following script in ssh:

sudo python3.8 -m synoindexwatcher /volume1/photo/photo_toto/synchro_portable/sd_card_camera Password: 2024-01-02 21:35:39,080 INFO Adding watch for path: /volume1/photo/photo_toto/synchro_portable/sd_card_camera 2024-01-02 21:35:39,324 INFO Waiting for media file changes...

and then if I add new files in the sd_card_camera folder, nothing happen.

I tried with several file creation including :

XXX@YYY:/volume1/photo/photo_toto/synchro_portable/sd_card_camera$ touch test2.txt

please note that it worked month/weeks ago maybe a package on my side broke the script ? I used task manager to start the script on startup.

iostrym commented 8 months ago

no idea ? or maybe is there a way to help understanding where could be the problem ?

iostrym commented 7 months ago

hello, I tryied the debug option and now I have this when I launch the command line:

[...] 2024-01-27 21:12:02,446 DEBUG Added watch 33 2024-01-27 21:12:02,446 DEBUG Added info for watch 33: {'children': {}, 'filter': <function build_filter..filter at 0x7f9813076ee0>, 'ma sk': 970, 'name': "2024-01-01 jour de l'an", 'parent': 2} 2024-01-27 21:12:02,447 DEBUG Name has been filtered, not adding watch: @eaDir 2024-01-27 21:12:02,462 DEBUG Name has been filtered, not adding watch: @eaDir 2024-01-27 21:12:02,462 INFO Waiting for media file changes...

Then I open my folder on windows and just reading the folder make it appears (Thumbs.db file are updated when reading on windows) and it is great because it means the python script is working:

2024-01-27 21:13:09,311 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/sd_card_camera/Thumbs.db' 2024-01-27 21:13:09,718 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/sd_card_camera/Thumbs.db'

also after adding some files, I have:

2024-01-27 21:26:16,932 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/IMG_20220108_151401 - Copie - Copie - Copie.jpg' 2024-01-27 21:26:16,955 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/IMG_20220108_151401 - Copie (2) - Copie - Copie.jpg' 2024-01-27 21:26:16,978 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/IMG_20220108_151401 - Copie (3) - Copie.jpg' 2024-01-27 21:26:17,003 DEBUG Calling 'synoindex -a /volume1/photo/photo_toto/synchro_portable/IMG_20220108_151401 - Copie - Copie (2).jpg'

I can also see in DSM 6.X in the GUI that there is some quick indexing currently done (on these files) but I can't see them on photostation or moment.

there is a problem elsewhere or maybe the synoindex command no more works on DSM 6.X ?

letorbi commented 7 months ago

Hi @iostrym, sorry for the late reply. I will investigate into the issue next week. Thanks for your efforts to add more details.

Just to be sure: You are not using Synology Photo, so your problems are not related to issue #51, right?

iostrym commented 7 months ago

I don't think this is related and also I use DSM 6.X

it is strange because I have the feeling it is working when I type directly this in ssh (mobaxterm for instance) :

sudo python3.8 -m synoindexwatcher /volume1/photo/photo_armand/synchro_portable/

but if I type this command with "&" at the end using the task manager:

sudo python3.8 -m synoindexwatcher /volume1/photo/photo_armand/synchro_portable/ &

it seems it doesn't work.

I can also check if process exist using the command:

ps -aux | grep synoindexwatcher

using mobaxterm I can see the process using task manager I can't see the process

maybe there is a problem with taskmanager or with the & at the end of the command ?

iostrym commented 7 months ago

in fact my complete command has several path like this :

sudo python3.8 -m synoindexwatcher path1 path2 path3 path4, etc.

and I got the following error message:

2024-01-29 07:48:55,756 ERROR No inode watchers left (see https://github.com/letorbi/synoindexwatcher#faq)

does the command complete anyway ? if can't set several path, then can I launch the script several path, one for each path ?

iostrym commented 7 months ago

using sysctl -w fs.inotify.max_user_watches=204800 resolve the problem. but the other problem I have is that the process is killed when I quit the terminal. even if I add "&" at the end of my command.

iostrym commented 7 months ago

problem seems to be resolved now because if I launch the process from DSM task manager then the process is kept alive... I will keep informed but currently it is working.

gitraphha commented 7 months ago

using sysctl -w fs.inotify.max_user_watches=204800 resolve the problem. but the other problem I have is that the process is killed when I quit the terminal. even if I add "&" at the end of my command.

the & will only put your process in the background. It will die if you leave the shell (quit the terminal). Try "disown" after putting your process in the background. This will detach it from the current shell/terminal, so it shouldn't be killed.