Topic "File Sync Daylight Savings Issue"

Author Message
ekirkco

Guest


I recently set up a sync using the .Net libraries. I'm syncing from/to Windows Server 2008r2. Both are set to US Central Time with Daylight Savings enabled. I'm using Bitvise SSH Server, (winsshd), on the remote server. The sync works fine, but for some reason the modified stamps are an hour earlier on the remote server. I tried opening WinSCP, setting it to "adjust remote timestamp with DST" and saving as default which updated my .ini file. I also tried sessionOptions.AddRawSettings("ConsiderDST","1") in my .Net code.(found this google hit: <invalid link removed by admin>) To test these, I deleted a file from the remote server and ran the sync. In both cases the file I deleted was recreated with a modified date that was still off by an hour. Any ideas what would be going on here? From the documentation it seems like 2008r2 shouldn't be affected, but it's hard to tell. Here's the code if it helps:

Code:
SessionOptions sessionOptions = new SessionOptions
{
    Protocol = Protocol.Sftp,
    HostName = context.MergedJobDataMap.GetString("HostName"),
    PortNumber = context.MergedJobDataMap.GetInt("PortNumber"),
    UserName = context.MergedJobDataMap.GetString("UserName"),
    //Password = context.MergedJobDataMap.GetString("Password"),
    SshPrivateKeyPath = context.MergedJobDataMap.GetString("PrivateKeyPath"),
    SshHostKeyFingerprint = context.MergedJobDataMap.GetString("SshHostKeyFingerprint")
};

using (Session session = new Session())
{
    // Will continuously report progress of synchronization
    session.FileTransferred += delegate(object sender, TransferEventArgs e){
        if(e.Removal != null && e.Removal.FileName != null)
        {
            Log.Info("Removing file: "+e.Removal.FileName);
        }
        Log.Info("File transferred: "+e.FileName);
    };

    session.Open(sessionOptions);

    SynchronizationResult synchronizationResult;
    synchronizationResult =
        session.SynchronizeDirectories(
            (SynchronizationMode)Enum.Parse(typeof(SynchronizationMode), context.MergedJobDataMap.GetString("SynchronizationMode")),
            context.MergedJobDataMap.GetString("LocalDirectory"),
            context.MergedJobDataMap.GetString("RemoteDirectory"),
            context.MergedJobDataMap.GetBoolean("DeleteFiles"));

    // Throw exception on any error
    synchronizationResult.Check();
}



Thanks,
--Evan[/code]
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Where do you observe a shifted timestamp? In WinSCP listing on remote panel? In Windows Explorer? Or both? Please attach a full log file showing upload of a single file. Please indicate timestamp you expect the file should have a timestamp you actually see.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License