Author Topic: I cannot change FileModifyDate in Linux(Synology NAS)  (Read 304 times)

victoryaaa

  • Newbie
  • *
  • Posts: 6
I cannot change FileModifyDate in Linux(Synology NAS)
« on: January 30, 2019, 11:50:03 AM »
Hello.

I cannot change FileModifyDate in Linux(Synology NAS DS218+) like the following.
(I can change other time like datetimeoriginal.)
In addition, it(FileModifyDate change) is working well in Window.
Would you please let me know how to change FileMofidyDate in Linux(Synology NAS DS218+)?

Thank you.

-----------------------------------------------------------------------------------------------------------------------------------
// 1. Original Information
.../Image-ExifTool-11.26$ ./exiftool  ../DSLR/Test/20181231_135333.jpg | grep "20"
File Name                       : 20181231_135333.jpg
File Modification Date/Time     : 2019:01:31 00:54:08+09:00
File Access Date/Time           : 2019:01:31 01:31:52+09:00
File Inode Change Date/Time     : 2019:01:31 01:31:52+09:00
Modify Date                     : 2018:12:31 13:53:33
Exif Version                    : 0220
Date/Time Original              : 2018:12:31 13:53:33
Create Date                     : 2018:12:31 13:53:33
Time Stamp                      : 2018:12:31 13:53:33+09:00

// 2. Try to change FileModifyDate
.../Image-ExifTool-11.26$ ./exiftool "-filemodifydate<datetimeoriginal" ../DSLR/Test/20181231_135333.jpg
    1 image files updated

// 3. FileModifyDate is not changed
.../Image-ExifTool-11.26$ ./exiftool  ../DSLR/Test/20181231_135333.jpg | grep "20"
File Name                       : 20181231_135333.jpg
File Modification Date/Time     : 2019:01:31 00:54:08+09:00
File Access Date/Time           : 2019:01:31 01:38:54+09:00
File Inode Change Date/Time     : 2019:01:31 01:38:54+09:00
Modify Date                     : 2018:12:31 13:53:33
Exif Version                    : 0220
Date/Time Original              : 2018:12:31 13:53:33
Create Date                     : 2018:12:31 13:53:33
Time Stamp                      : 2018:12:31 13:53:33+09:00

// 4. Try to change DateTimeOriginal
.../Image-ExifTool-11.26$ ./exiftool "-datetimeoriginal<filemodifydate" ../DSLR/Test/20181231_135333.jpg
    1 image files updated

// 5. It is changed well.
.../Image-ExifTool-11.26$ ./exiftool  ../DSLR/Test/20181231_135333.jpg | grep "20"
File Name                       : 20181231_135333.jpg
File Modification Date/Time     : 2019:01:31 01:40:30+09:00
File Access Date/Time           : 2019:01:31 01:40:31+09:00
File Inode Change Date/Time     : 2019:01:31 01:40:30+09:00
Modify Date                     : 2018:12:31 13:53:33
Exif Version                    : 0220
Date/Time Original              : 2019:01:31 00:54:08
Create Date                     : 2018:12:31 13:53:33
Time Stamp                      : 2018:12:31 13:53:33+09:00


StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2372
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #1 on: January 30, 2019, 01:02:33 PM »
You may have to wait until Phil (the author) comes back from vacation.  The "-filemodifydate<datetimeoriginal" should work, though on linux you might try using single quotes instead of double quotes. 

When editing metadata internal to the file (such as DateTimeOriginal) rather than filesystem data (such as FileModifyDate), you might see if the -P (preserve) option preserves the FileModifyDate.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

victoryaaa

  • Newbie
  • *
  • Posts: 6
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #2 on: February 01, 2019, 12:11:57 PM »
I have tried using single quotes instead of double quotes but it does not work.
I am give you more information.
My OS is Linux and exiftool version is 11.26.
In addition, GPS coords has no problem.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #3 on: February 08, 2019, 01:23:03 PM »
I just tried this on Linux:

Code: [Select]
% exiftool a.jpg -filemodifydate -datetimeoriginal
File Modification Date/Time     : 2014:10:27 06:47:41-04:00
Date/Time Original              : 1998:05:01 21:33:18
% exiftool a.jpg "-filemodifydate<datetimeoriginal"
    1 image files updated
% exiftool a.jpg -filemodifydate -datetimeoriginal
File Modification Date/Time     : 1998:05:01 21:33:18-04:00
Date/Time Original              : 1998:05:01 21:33:18

Check that you have write permission, but if you didn't I would expect an error.

- Phil


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

victoryaaa

  • Newbie
  • *
  • Posts: 6
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #4 on: February 09, 2019, 03:05:23 AM »
As you can see the following #2, it has write permission.

I found that the problem happens in only sysnology NAS.
I have checked it in ubuntu and it has no problem.
I think it has some difference although it is the same linux OS.

In addition, I have found the post(#1 link) and Nexius2 may have a lot of experience to use your exiftool in synology NAS.
Therefore I will send him the direct message and inquire that he has same problem and ask him to see this post.

Would you please help me with him?
Thank you for your support.

--------------------------------------------------------------------------------------------------------
#1. Post Link
--------------------------------------------------------------------------------------------------------
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,6157.msg30362.html#msg30362

--------------------------------------------------------------------------------------------------------
#2. Test Result
--------------------------------------------------------------------------------------------------------
admin@hss218:/volume1/photo_DSLR_CR2/Image-ExifTool-11.26$ ls -l
total 72108
-rwxrwxrwx+ 1 admin users  3874621 Dec 19 00:36 20181011_192439.jpg
-rwxrwxrwx+ 1 admin users 69101556 Dec 18 01:59 20181011_193120.mp4
...
admin@hss218:/volume1/photo_DSLR_CR2/Image-ExifTool-11.26$ ./exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg
File Modification Date/Time     : 2018:12:19 00:36:58+09:00
Date/Time Original              : 2018:10:11 19:24:39
admin@hss218:/volume1/photo_DSLR_CR2/Image-ExifTool-11.26$ ./exiftool "-filemodifydate<datetimeoriginal" 20181011_192439.jpg
    1 image files updated
admin@hss218:/volume1/photo_DSLR_CR2/Image-ExifTool-11.26$ ./exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg
File Modification Date/Time     : 2018:12:19 00:36:58+09:00
Date/Time Original              : 2018:10:11 19:24:39

Nexius2

  • Jr. Member
  • **
  • Posts: 15
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #5 on: February 09, 2019, 03:38:08 AM »
Hello,
your commands are good and working!
just made a test on my side.

exiftool 2005-02-15_13-19-32.jpg
File Modification Date/Time     : 2017:07:05 13:19:39+02:00
Date/Time Original              : 2005:02:15 13:19:32

exiftool "-filemodifydate<datetimeoriginal" 2005-02-15_13-19-32.jpg

exiftool 2005-02-15_13-19-32.jpg
File Modification Date/Time     : 2005:02:15 13:19:32+01:00
Date/Time Original              : 2005:02:15 13:19:32

I guess tou have a problem with your Exiftool version.
wich one are you using?
I would suggest you use mine ;-)
https://www.cphub.net/?id=40&pid=801
beta and production release available, you just have to add the repo to your nas but I'd guess you know how to



victoryaaa

  • Newbie
  • *
  • Posts: 6
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #6 on: February 09, 2019, 12:08:21 PM »
Hello,

It has the same problem although I install your lattest beta version.
In addition, I have found something strange.
I made the shell script like the following.

-----------------------------------------------------------------
#!/bin/bash

echo "Before"
echo $(exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg)
exiftool "-filemodifydate<datetimeoriginal" 20181011_192439.jpg
echo "After"
echo $(exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg)
sleep 1
echo $(exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg)
sleep 1
echo $(exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg)
sleep 1
echo $(exiftool -filemodifydate -datetimeoriginal 20181011_192439.jpg)
-----------------------------------------------------------------

The result is the following.
It means that filemodifydate changed well originally but it was reverted soon.
My NAS model is DS218+ and DSM version is DSM 6.2.1-23824 Update 4.
Please recommend what I should do to figure the issue more.

-----------------------------------------------------------------
admin@hss218:/volume1/photo/Test$ ./test.sh
Before
File Modification Date/Time : 2018:12:19 00:36:58+09:00 Date/Time Original : 2018:10:11 19:24:39
    1 image files updated
After
File Modification Date/Time : 2018:10:11 19:24:39+09:00 Date/Time Original : 2018:10:11 19:24:39
File Modification Date/Time : 2018:12:19 00:36:58+09:00 Date/Time Original : 2018:10:11 19:24:39
File Modification Date/Time : 2018:12:19 00:36:58+09:00 Date/Time Original : 2018:10:11 19:24:39
File Modification Date/Time : 2018:12:19 00:36:58+09:00 Date/Time Original : 2018:10:11 19:24:39
-----------------------------------------------------------------

Nexius2

  • Jr. Member
  • **
  • Posts: 15
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #7 on: February 10, 2019, 12:59:21 AM »
Hello, did you try with other files?
your issue seams to be with something else then Exiftool.
and your saying you can change that same file on ubuntu?
where is your file on the nas and what packages do you have running?

victoryaaa

  • Newbie
  • *
  • Posts: 6
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #8 on: February 10, 2019, 11:50:57 AM »
Hello,

All of files have same problem.
Yes, same file is changed well in ubuntu.
My files are in normal photo path(/volume1/photo/) on the nas.
And, I just run file station and photo station.
I have tried it after rebooting nas and not starting any package, but the problem is same.
I think some background program may effect the problem.

Thank you.

Nexius2

  • Jr. Member
  • **
  • Posts: 15
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #9 on: February 11, 2019, 03:39:08 AM »
Yes, I would say the same.
or your files have a particuliar problem.
coud you send me a file so I can have a try?
edit and color the photo if you dan't wan't it to be seen ;-)
and have a try again after the edit, we never now :-D

victoryaaa

  • Newbie
  • *
  • Posts: 6
Re: I cannot change FileModifyDate in Linux(Synology NAS)
« Reply #10 on: February 12, 2019, 09:17:16 AM »
Hello,
The cause of the problem was Drive package.
After Stopping Drive package, filemodifydate is changed well by exiftool.
Drive package may revert filemodifydate whenever I try to change it by exiftool.
Your hint helps me solving the problem.
I owe you big time.
Thank you very much.