• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Keep timestamp on ftp upload

I

ingel

Guest
Trying to find out how to get this to work, as it is now the timestamp is set to the time of upload, but I want to keep the original file time/date.
In my ftp program, WS_FTP, it says that 'MDTM support is required' to preserve time. Any help appreciated.
 
Last edited by a moderator:
The filesystem on a unix / linux server alters the timestamp. However sending from another unix / linux machine, the timestamp is then the time stamp of the originating file not the time the server receives the file, it it is already existing.

If its a new file completely its then set to received by the servers time.

You have to use touch on your server to change it. Simply set up a scheduled task to do this at what ever interval you like.
 
Thanks! I must admit that I don't really understand what you mean by "You have to use touch on your server to change it.", but I'll try to explain a bit more:
When I upload files with WS_FTP (my ftp program) there is a configuration setting where you can select if you want to keep the original timestamps or not. However, there is a note in the setting description that 'MDTM support is required to preserve time.'
This works on some servers, but some always generate a new stamp. The latter is the case with the Plesk VPS server I'm currently trying to set up.
Regardless if the file is new, or if I'm overwriting a file thats already exist at the server, the timestamp is always set to the time of upload.
It's important for me to keep the timestamps if I have the restore the server from my local backup. F.ex. I have some gallery folders containing photos and I must be able to list them chronologically at the server based on their original timestamp.
Also, keeping the timestamps is handy when it comes the verify file revisions.

So my question is how to enable MDTM support for my VPS.
 
Last edited by a moderator:
Easiest way as time of file is so important.

Just set up a cron to set the time on the file as often as you like

touch -t 200903301000 /var/www/vhosts/domain.com/httpdocs/extra/directories/file.name

-t tells to use timestamp
200903301000

2009 year
03 month
01 day
10 hour of day
00 minute of hour

As cron runs from shell you have to specify the full path to the file as in my example.
 
Thanks again! And I'm sorry, I still don't understand.
blush.gif

From my old server I have around 70,000 photos with timestamps ranging from 2002 until present. How shall I get these transferred by FTP to my new Plesk based VPS with their timestamps intact?
 
Don't do it by ftp! If they are already online, shell in and gzip them up - ftp this and then extract them on your new server. The directories, times and files are maintained!
 
Thanks, yes, I could do that on the initial upload. But I also need to be able to upload with FTP for later 'houskeeping'.

It's beyond me why the server is not set up as I want as default. Even if MDTM is supported, you dont have to use it, is an option.
 
Back
Top