1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Keep timestamp on ftp upload

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by ingel, Mar 31, 2010.

  1. ingel

    ingel Guest

    0
     
    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: Mar 31, 2010
  2. 105547111

    105547111 Silver Pleskian

    32
    30%
    Joined:
    Jul 13, 2006
    Messages:
    643
    Likes Received:
    2
    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.
     
  3. ingel

    ingel Guest

    0
     
    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: Apr 1, 2010
  4. 105547111

    105547111 Silver Pleskian

    32
    30%
    Joined:
    Jul 13, 2006
    Messages:
    643
    Likes Received:
    2
    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.
     
  5. ingel

    ingel Guest

    0
     
    Thanks again! And I'm sorry, I still don't understand. [​IMG]
    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?
     
  6. 105547111

    105547111 Silver Pleskian

    32
    30%
    Joined:
    Jul 13, 2006
    Messages:
    643
    Likes Received:
    2
    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!
     
  7. ingel

    ingel Guest

    0
     
    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.
     
  8. atomicturtle

    atomicturtle Golden Pleskian

    29
     
    Joined:
    Nov 20, 2002
    Messages:
    2,110
    Likes Received:
    7
    Location:
    Washington, DC
    Or you could transfer them with rsync:

    rsync -av -e ssh /path/to/src/dir/ user@secondserver:/path/to/dst/dir/
     
Loading...