File Sync Daylight Savings Issue
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:
Thanks,
--Evan[/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]