Synology - exiftool Script sort files leads to "Warning: Error opening file"

Started by caliban, December 21, 2015, 01:00:21 PM

Previous topic - Next topic

caliban

Hi There

I have a synology DS211+. To sort and move pictures automatically i created a script with exiftool and run it with the taskscheduler. So if i run the same cmd line it works smoothly trough ssh (putty)
exiftool '-Directory<CreateDate' -d /volume1/photo/targetfolder/%Y-%m-%B -r /volume1/photo/sourcfolder

if i let it run trough the taskscheduler i get following error:

+ exiftool -Directory<CreateDate -d /volume1/photo/targetfolder/%Y-%m-%B -r /volume1/photo/sourcefolder
Warning: Error opening file - /volume1/photo/sourcefolder
Error: File not found - /volume1/photo/sourcefolder
    0 image files updated
    1 files weren't updated due to errors
+ echo Done
Done


My script is simple:

#!/bin/sh
exiftool '-Directory<CreateDate' -d /volume1/photo/targetfolder/%Y-%m-%B -r /volume1/photo/sourcefolder
echo "Done"


The Taskscheduler Run Command:

sh -x /volume1/Verwaltung/taskschedulescript/movepic.sh > /volume1/Verwaltung/taskschedulescript/Log/movepic.log 2>&1

I'm guessing that something is not wright with pointing to the directory put i'm lost...

Hope someone can point me in the right direction.

Thanks

Phil Harvey

This could be due to the permissions of the script when run under taskscheduler.  Make sure that the taskscheduler user has read permission for the sourcefolder and write permissions for the targetfolder.

Either that or you mistyped "sourcefolder" in your script command.  (It was "sourcfolder" in your cmd line command.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

caliban

ok good news - i was able to create a script that works with synology

#!/bin/sh
exiftool '-Directory<CreateDate' -d "/volume1/photo/targetfolder/%Y-%m-%B" -r "/volume1/photo/sourcefolder"
echo "done"


The difference was the >"< for the folders name

Now when i execute trough the task scheduler i get this:

+ exiftool -Directory<CreateDate -d /volume1/photo/targetfolder/%Y-%m-%B -r /volume1/photo/sourcefolder
Warning: No writable tags set from /volume1/photo/sourcefolder/@eaDir/DSC_0306.JPG/SYNOPHOTO_THUMB_PREVIEW.jpg
Warning: Error opening file -
Error: File not found -
    3 directories scanned
    1 image files updated
    1 image files unchanged
    1 files weren't updated due to errors
+ echo done
done


What i don't get why i still get the Error opening file "-", it works but this one doesn't make sense for me.

caliban

Thanks Phil

the "sourcfolder" was a typo "sry  ::)

I found the solution how it works - see my latest post. it wasn't a permission thing, then i used the root permission in the task scheduler settings.

Quote from: Phil Harvey on December 21, 2015, 03:34:16 PM
This could be due to the permissions of the script when run under taskscheduler.  Make sure that the taskscheduler user has read permission for the sourcefolder and write permissions for the targetfolder.

Either that or you mistyped "sourcefolder" in your script command.  (It was "sourcfolder" in your cmd line command.)

- Phil

Phil Harvey

The file name should appear after "Error opening file - ".  The fact that you don't see the name indicates that the name is composed of non-printable characters.  I'm not sure what is happening in your case, but a space then a non-breaking space at the end of the command could do it.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).