-
Myriad_Rocker
Guest
Preserve Remote Timestamp – Command Line?
Advertisement
I know you can set 'Preserve Remote Timestamp' in the GUI. But can you do it on the command line? I'm not using the GUI to transfer...I'm using command via a Perl script.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,441
- Location:
- Prague, Czechia
Re: Preserve Remote Timestamp - Command Line?
It is enabled by default, but anyway, try to use
https://winscp.net/eng/docs/scriptcommand_put#preservetime
https://winscp.net/eng/docs/scriptcommand_get#preservetime
-preservetime
switch:
https://winscp.net/eng/docs/scriptcommand_put#preservetime
https://winscp.net/eng/docs/scriptcommand_get#preservetime
-
Myriad_Rocker
Guest
Yeah, it's definitely changing the time stamp. By one hour exactly. I combed the site and did not find the stuff you linked to. I appreciate it. I will try this out.
- Myriad_Rocker
- Joined:
- Posts:
- 5
- Location:
- U.S.
Ok, I tried this. It didn't work but maybe I am doing it incorrectly. Here is the command in my Perl script.
Notice that I put the
Thoughts?
my $command = "winscp.com /command \"option batch abort\" \"option confirm off\" \"open -hostkey\=\"\"ssh-rsa 1024 6a:b7:2a:ad:31:05:f6:e0:74:78:59:d8:64:e8:17:fd\"\" user1:password\@11.111.111.111\" \"put -preservetime \"\"$search_path\\$x\"\" $target\" \"exit\"";
-preservetime
switch right after the put
. Is that where it is supposed to go? When I used this, the file transferred successfully, but the timestamp was back one hour. Original Stamp: 3:05AM After transfer: 2:05AM
Thoughts?
Okay, so I changed it up and put it as an option, but the command window is saying "Unknown switch 'preservetime'".
Advertisement
-
martin◆
Site Admin
Ok, so it is preserving the time actually, isn't it? Just incorrectly. So the problem is elsewhere.
Please read:
https://winscp.net/eng/docs/timestamp
Please read:
https://winscp.net/eng/docs/timestamp
I had this issue when using the Saved Sessions to access instead of embedding the host key directly as I am above. I fixed it by adjusting something, I know that. Is there a switch for the Adjust Remote Timestamp with DST setting?
- Myriad_Rocker
- Joined:
- Posts:
- 5
- Location:
- U.S.
I can confirm that, when I create a session and use that session at command with the "Adjust remote timestamp with DST" option selection, it works perfectly. I'd like to NOT use a saved session, though. I'd like to connect with a connection string in my command.
So...what is the switch to set "Adjust remote timestamp with DST"? And where do I place it? On the
So...what is the switch to set "Adjust remote timestamp with DST"? And where do I place it? On the
put
level or on the option
level?
- Myriad_Rocker
- Joined:
- Posts:
- 5
- Location:
- U.S.
Alright, I fixed this by inserting a new
I also saw a
DWORD
into the Default Settings
of WinSCP in the registry. I looked at a saved session to get the key word, which is ConsiderDST
. Value should be 0
.
I also saw a
-rawsettings
function but the page said it only worked with the beta. But it didn't say which version. I'd like to set this ConsiderDST
setting on command line, so how would I do that? I don't want to have to alter the registry for this kind of thing.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,441
- Location:
- Prague, Czechia
I'd like to set thisConsiderDST
setting on command line, so how would I do that? I don't want to have to alter the registry for this kind of thing.
open ... -rawsettings ConsiderDST=0
Advertisement
You can post new topics in this forum