Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: How to preserve times when copying images from smartmobile usb memory to Linux disk

  1. #1

    Default How to preserve times when copying images from smartmobile usb memory to Linux disk

    Using openSUSE 13.2, kernel 3.16.7 x86_64 and Gnome 3.14.4 desktop. When connecting my Samsung S4 smartmobile using a usb connection, the default behavior "Open with Files" launches mtp://[usb:001,003]/ in Nautilus.

    Going down to mtp://[usb:001,003]/Card/DCIM/Camera loads (lists) all image files on the usb memory.
    Copy image files and Paste into another Nautilus tab disk folder works, but the original image times are not preserved during copying and changes to the current operation time.

    Is there any method to preserve times using the default Nautilus (gui) for this 'Copy & Paste' job?

    A related problem is that the smartmobile usb memory is not listed among mounts using the command line "df -h".
    In comparision, my external usb backup disk is shown when connected, and it is possible to use the command line tools "rsync" or "cp -p" to preserve file stamps during copying.

    How to possibly find the mount point for the usb memory so that the command line tools can be used?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,935
    Blog Entries
    2

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    AFAIK, no.
    So unless someone suggests something I'm not aware of...

    This is because Nautilus is a file manager, so does operations at the file level.
    When you copy something, you're creating a brand new instance of the original file, so the new file will be timestamped with the new time.

    But, if you did a file copy operation at the disk block level (like using the command line dd) then the timestamps would be preserved.

    A common workaround I've seen for your scenario is to name the file based on the date.

    TSU

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,869

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    Quote Originally Posted by terjejh View Post
    How to possibly find the mount point for the usb memory so that the command line tools can be used?
    A rather hidden question at the end of this story

    You can find what is mounted where with
    Code:
    mount
    You can reduce the amount of output by filtering on the mounts that use mass-storage devices (in /dev):
    Code:
    mount | grep '/dev'
    Henk van Velden

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,519
    Blog Entries
    15

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    Hi
    What about go-go-mtpfs and there is mtp-tools. There is also mptfs at https://build.opensuse.org/package/s...&package=mtpfs
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to preserve times when copying images from smartmobile usbmemory to Linux disk

    On 2015-06-18 22:46, tsu2 wrote:

    > This is because Nautilus is a file manager, so does operations at the
    > file level.
    > When you copy something, you're creating a brand new instance of the
    > original file, so the new file will be timestamped with the new time.


    'mc' /preserves/ the timestamps. What it does is that first it creates
    the new file, then it modifies the timestamps. This is an optional
    behaviour.


    > A common workaround I've seen for your scenario is to name the file
    > based on the date.


    Or use exif data.


    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to preserve times when copying images from smartmobile usbmemory to Linux disk

    On 2015-06-18 16:06, terjejh wrote:


    > How to possibly find the mount point for the usb memory so that the
    > command line tools can be used?


    Impossible. When using the "mtp" protocol, there is no actual mount.
    Nautilus fakes it.

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,869

    Default Re: How to preserve times when copying images from smartmobile usbmemory to Linux disk

    Quote Originally Posted by robin_listas View Post
    Or use exif data.
    When they are JPEG files that might be a solution for you. Use
    Code:
    jhead -ft *.jpg
    (or any other suitable expression for *.jpg in your situation)
    For more information of course
    Code:
    man jhead
    I do not know if jhead is installed by default. Else instal it e.g.
    Code:
    su -c 'zypper in jhead'
    Henk van Velden

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,935
    Blog Entries
    2

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    Manipulating exif data directly and indirectly using something like jhead only modifies the image file metadata, the regular file properties remain as I described.
    Unless you use an image viewing app, ordinarily this metadata isn't visible although it can contain a lot of useful information.

    It generally shouldn't be visible in a regular file manager unless the file manager has extensions to read the metadata (some/many do).

    TSU

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,869

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    jhead does not "only" work on work on the internal meta data. It can also set the files date/time in the file system. And that is what the -ft does. It reads the date the picture was made from the meta data (called Exif in the case of JPEG) and then uses an equivalent of touch -d to set the date/time in the file system accordinly. This will most probably restore the original date/time of the file as it was on the camera.
    Henk van Velden

  10. #10
    Join Date
    Jun 2008
    Location
    Florida, USA
    Posts
    970

    Default Re: How to preserve times when copying images from smartmobile usb memory to Linux disk

    terjejh;
    You might take a look at package Digikam, an open source photo management program.
    It loads by default on a KDE system, I'm not sure about Gnome.

    Of the zillions of things it does, it allows you to rename files based on exif metadata.

    You might find all of digikam useful, or you might find a way to use the file renamer.

    You might also have a look at exiftool
    Desk: i7-4790K Leap 15.1(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0
    Lap: HPDV7T i7 Leap 15.0(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0

Page 1 of 4 123 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •