MTP does not work in Ubuntu so I am using Airdroid to copy photos off my phone (Galaxy Nexus) to my computer (Ubuntu 12.04). My problem is that the files downloaded via Airdroid all have modification date of when I transferred them. I want the files to keep the timestamps they have on the phone (which is the date and time I took the photo).

How can I do this?

  • This is also an Ubuntu / device issue.
    – david6
    Oct 5 '12 at 8:31

Reason is your client saves them at that time, and doesn't ask the "server" (your Android device) for the original time stamps.

You could try using a SSH server on your Android device. DroidSSHd would be a good choice, for example. To copy your files then you need to start this SSH Server first on your phone, which usually tells you the IP and port used. Now you can use any SSH client on your Ubuntu workstation, or from the shell, use the scp command:

scp -p -P 2222*.jpg .

would be an example:

  • -p: Preserves modification times, access times, and modes from the original file
  • -P 2222: Use port 2222 (that's what DroidSSHd uses by default)
  • IP of your device (replace this with what the SSH server shows)
  • /sdcard/DCIM/*.jpg: All JPEG files from your camera folder on the SD-card (check for the correct path)
  • .: Copy files to the current working directory

Note that at least on Linux, for ease of use you can tell SSH in its config to always use port 2222 for this IP adding the following lines to your ~/.ssh/config file:

    Port 2222

Having done that, you no longer need to specify -P 2222 with each command.

There might be graphical solutions available as well -- but I mostly work from the command line, so I cannot give you examples for those.

  • This is the classic push/pull issue with FTP. If you copy files to your PC (push), it does not trust the source (and replaces the time/date stamps). If you copy files from the device (pull), your PC has control and retains the time/date stamps. The same issue occurs when FTP copying between two Ubuntu hosts, using Nautilus. If you can configure settings, you can overcome this.
    – david6
    Oct 5 '12 at 8:27
  • When I push files with scp or rsync, this issue does not occur either. But confirmed, the described issue is "incorrectly titled" Airdroid modifies timestamps, as the modification is rather done by the receiving client. And also agreed, it is more likely to happen with FTP.
    – Izzy
    Oct 5 '12 at 8:57
  • Thank you, using scp worked fine. I do think it was airdroid modifying the timestamps in my case, because all my pictures were packed into a .zip which was downloaded via browser. I don't care what the modification date of the zipfile was, but the photos inside all had new useless dates generated too - surely this was airdroid.
    – wim
    Oct 6 '12 at 3:53
  • 1
    @GeorgeProfenza I suggest you open a new question for that. You can link to this one for reference.
    – Izzy
    Jul 3 '13 at 12:50
  • 1
    @Sigur I don't think so. This path usually points to the "primary external storage", which is the internal SD card (if available) or the external (if no internal SD card is there). You can use a file manager to check if the path is present.
    – Izzy
    Jun 22 '15 at 13:12

Running an SSH server on your phone helps you with this problem, just as the previous answer explained. However, because DroidSSHd is older and may not work with newer phones on more recent versions of Android, SSHelper might be a better choice, and I use it regularly for purposes similar to this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.