• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Copying files to Galaxy Nexus and preserving time/date

paroots

Well-Known Member
When I do a restore, I'm able to copy files from my PC to phone, but the time/date of file is lost. The files on phone show the current date. I've tried copying via WiFi and USB with the same result. Anyone know how to preserve the time/data info of file?
Pete
 
When I do a restore, I'm able to copy files from my PC to phone, but the time/date of file is lost. The files on phone show the current date. I've tried copying via WiFi and USB with the same result. Anyone know how to preserve the time/data info of file?
Pete

Easiest way is to put the date in the name of the file, depending on what it is, but i know i keep backups on my computer for my phone if i really enjoy a setup and want to make sure i have a spare just in case, and the date/time do not stay on it so i do something like: Cyanogen10 Backup 10.2.12

Hope this helps :S
 
Easiest way is to put the date in the name of the file, depending on what it is, but i know i keep backups on my computer for my phone if i really enjoy a setup and want to make sure i have a spare just in case, and the date/time do not stay on it so i do something like: Cyanogen10 Backup 10.2.12

Hope this helps :S
Thanks. So you experience the same problem? In the case of the camera, it automatically codes the date and time into the file name of any pics which is nice. Do you know of any way to copy and preserve date and time?
Pete
 
I would suggest try using an app like File Manager to see if it preserves it, i have never tried it, but it wouldn't hurt to test it out.

Also i found this for Phone to PC, i think...this should work...idk about going from PC to phone though....

Use XCOPY through a command window and you can retain attributes. This ofcourse only works when you're connected to a windows PC.

For Example:
C:\>xcopy filename.txt /K F:\target_directory\filename.txt

You would need to set the target (second part) to the drive letter and directory of your tablet's drive. It may ask if the target is a file or directory, press "f" to specify file and it should copy.

the /K option in XCOPY will copy attributes, in this case the file creation date is the one you care about.
 
I would suggest try using an app like File Manager to see if it preserves it, i have never tried it, but it wouldn't hurt to test it out.

Also i found this for Phone to PC, i think...this should work...idk about going from PC to phone though....
Thanks again. I've tried both ES File Explorer and File Expert with the same result. On the PC, I've used Directory Opus over both WiFi and USB. All have the same results. The xcopy is a good idea, but the first problem is that the phone doesn't show up with a drive letter? It shows up as 'Galaxy Nexus'.
Pete
 
Hmm, did you check under properties to see if it is associated with a specific path, i mean it has to be otherwise you wouldn't be able to move anything to or from it because the computer wouldn't know where to grab or give items to.

Check this and get back to me.
 
Thanks again. I've tried both ES File Explorer and File Expert with the same result. On the PC, I've used Directory Opus over both WiFi and USB. All have the same results. The xcopy is a good idea, but the first problem is that the phone doesn't show up with a drive letter? It shows up as 'Galaxy Nexus'.
Pete
Thanks. Under properties there is no drive letter. If you go into Computer Management/Disk Management it doesn't show up at all. I have attached a screen shot of the way my drives appear in Directory Opus (which should be the same as Windows Explorer)
Pete
 

Attachments

  • GalaxyNexus.JPG
    GalaxyNexus.JPG
    37.5 KB · Views: 110
Okay so I'm pretty sure using ADB you could get the timestamps to remain unaltered.

Here is what i found about "ADB push", the method they are using to get the timestamps to remain unaltered.

have the following issue: when I am copying files/directories from my GNex to a PC or viceversa, the timestamps of the copied files are changed to <sysdate> (e.g. the actual timestamp at the moment of the transfer). This is a bug because the timestamp of a file should only be changed when the content of the file is modified. Copy/move operations should NOT alter the file timestamp.

I usually sort my multimedia collection by the date/time attribute, allowing me to reconstruct the actual timeline for all the photos/movies that I've made in time using different phone models.

The only workaround that I've found so far is to use the "adb push <dir> /mnt/sdcard/<dir>" command. This command does not alter the file timestamps, but the transfer rate is significantly lower than the MTP transfer rate. There is also an advantage for using this command: it works much faster when dealing with cascaded multiple small file transfers.

If you know any alternative method for copying files over the MTP protocol while preserving the original timestamps, please share it.
 
Okay so I'm pretty sure using ADB you could get the timestamps to remain unaltered.

Here is what i found about "ADB push", the method they are using to get the timestamps to remain unaltered.
Thanks. I could setup a batch file to do the adb commands. I haven't been using adb directly, only through a toolkit. I did find adb.exe on my HDD. Here is what I think the syntax may be:
adb push D:\Data\GNbackup\Test \mnt\sdcard\Test

which doesn't work. I suspect mnt must be replaced by something that identifies the phone.

Update: I got it working, but it didn't preserve the date/time stamp:

C:
cd \Program Files\Android-Sync\bin
adb -d push D:/Data/GNbackup/Test /mnt/sdcard/Test
Pete
 
I can verify that adb push will indeed save the timestamp when moving from the PC to the Gnex. Place the desired file into the folder on the PC where the adb utility resides (on newer version of the sdk, that would be the platform-tools folder). If you install the sdk onto the root of the C drive as most guides suggest, you would end up with a session that looks like this (assuming windows):

cd c:\android-sdk-windows\platform-tools
adb push nameoffile.jpg /data/media
 
Thanks for verifying iowabowtech, it must just be the correct pathing you need to get down, please get back to us Pete, on the progress you have made.
 
Yeah I just noticed he's trying to use adb through a toolkit. I might suggest you just load a freestanding version of the sdk. Here's a mini sdk which is ideal if all you're doing is using fastboot or adb commands:

https://dl.dropbox.com/u/7460142/android-sdk-windows.zip

Simply unzip to the root of your C drive. I'm assuming you already have driver recognition from your dealings with the toolkit. Once you navigate to the platform-tools folder, run the following command to check:

adb devices

If it returns your device s/n, you're good to go. Or you can try to work it all through the toolkit's adb location, up to you.

So if you go with my plan and including the connectivy check, your session will now look like this:

cd c:\android-sdk-windows\platform-tools
adb devices (if s/n outputs, then continue)
adb push nameoffile.jpg /data/media (file you want to push to phone placed in platform-tools folder on pc)
 
I can verify that adb push will indeed save the timestamp when moving from the PC to the Gnex. Place the desired file into the folder on the PC where the adb utility resides (on newer version of the sdk, that would be the platform-tools folder). If you install the sdk onto the root of the C drive as most guides suggest, you would end up with a session that looks like this (assuming windows):

cd c:\android-sdk-windows\platform-tools
adb push nameoffile.jpg /data/media
Thanks. I don't understand. I repeated the above command several times and each time the time/date updated to the current date and time?
Pete
 
Hmmm, idk man. I just pushed a .jpg to my phone that was dated august and it shows up on my phone as still having that august date? If I move with MTP, it changes to the current date as you mentioned. :confused:
 
Yeah I just noticed he's trying to use adb through a toolkit. I might suggest you just load a freestanding version of the sdk. Here's a mini sdk which is ideal if all you're doing is using fastboot or adb commands:

https://dl.dropbox.com/u/7460142/android-sdk-windows.zip

Simply unzip to the root of your C drive. I'm assuming you already have driver recognition from your dealings with the toolkit. Once you navigate to the platform-tools folder, run the following command to check:

adb devices

If it returns your device s/n, you're good to go. Or you can try to work it all through the toolkit's adb location, up to you.

So if you go with my plan and including the connectivy check, your session will now look like this:

cd c:\android-sdk-windows\platform-tools
adb devices (if s/n outputs, then continue)
adb push nameoffile.jpg /data/media (file you want to push to phone placed in platform-tools folder on pc)
Thanks. That's a nice little sdk to download; I'm sure I'll make good use of it. Unfortunately, when following your instructions, it continues to change the date/time to current date and time. Here is the actual cmd prompt window. BTW, the 'adb devices' command does return the serial number. I created a little batch file which lives in the same folder as the adb.exe file to save on retyping the command.
Pete
 

Attachments

  • adbTest.JPG
    adbTest.JPG
    45.7 KB · Views: 160
Since your example is for a single file, and mine copies a folder, I reran it with a single file. Here is the result. Again the date/time was changed to current.
Pete
 

Attachments

  • adbTest2.JPG
    adbTest2.JPG
    31 KB · Views: 73
Yeah I'm not quite sure how you're doing what your'e doing. I can't figure out how you are pushing a single file directly from the platform-tools folder when you're push command indicates a D:/ drive location?

The only thing I can come up with is to try and replicate a classic adb push command like I posted above and see if that changes the date. And use the push destination of /data/media if you're wanting to get it onto the sdcard.
 
Yeah I'm not quite sure how you're doing what your'e doing. I can't figure out how you are pushing a single file directly from the platform-tools folder when you're push command indicates a D:/ drive location?

The only thing I can come up with is to try and replicate a classic adb push command like I posted above and see if that changes the date. And use the push destination of /data/media if you're wanting to get it onto the sdcard.
Thanks. The adb command is being executed from within the folder where adb.exe lives, but I'm referencing a path/filename that happens to live on the D: drive. That shouldn't matter. My HDD is partitioned such that all programs live on C:\ and all data on D:\.
Pete
 
Thanks. The adb command is being executed from within the folder where adb.exe lives, but I'm referencing a path/filename that happens to live on the D: drive. That shouldn't matter. My HDD is partitioned such that all programs live on C:\ and all data on D:\.
Pete

It seems like it shouldn't matter if the files are indeed pushing to the phone but the end result doesn't seem to indicate such. And I can't quite put a finger on why that would be. Sorry.
 
This is as close as I could get to your syntax. I moved the file being pushed into the same folder as adb.exe. Still changing date/time.
 

Attachments

  • adbTest3.JPG
    adbTest3.JPG
    31.2 KB · Views: 80
I even decided to push a jpg file like you did to see if that made the difference. Same thing, the time/date is set to current.

BTW, I'm running Windows 7, what are you running?
Pete
 

Attachments

  • adbTest4.JPG
    adbTest4.JPG
    30.9 KB · Views: 75
Using the push destination of /mnt/sdcard/ it's working fine here. I'm absolutely floored on this one. I can't understand why this is happening to you and not myself.

Yep, I'm on Win7. Custom rom on the phone based on 4.1.1.
 
Using the push destination of /mnt/sdcard/ it's working fine here. I'm absolutely floored on this one. I can't understand why this is happening to you and not myself.

Yep, I'm on Win7. Custom rom on the phone based on 4.1.1.
I just flashed Android stock ROM 4.1.2 yesterday using NRT v1.5.3. Hope that's not the difference:p
Pete
 
Back
Top Bottom