2

Similarly to How to maintain a file's 'last modified' date ? I need to retain the date while copying the file by Krusader or in a 'Home Folder' window to another PC connected by SSH. Is it possible?

Tomáš Pečený
  • 1,407
  • 7
  • 19
  • 45

1 Answers1

2

You can do this with the -p option to scp. As explained in man scp:

 -p      Preserves modification times, access times, and modes from the
         original file.

So, just run

scp source_file user@host:/remote/path/file
terdon
  • 100,812
  • Is it possible to set generally in Krusader? I do not see such setting there. – Tomáš Pečený May 10 '14 at 20:38
  • @TomasPeceny I'm playing with it now. How exactly are you connecting to the remote directory? Are you using the fish protocol through krusadser's "Net connection" menu option? – terdon May 10 '14 at 20:42
  • Yes, I am using the fish protocol through krusadser's "Net connection" menu option. – Tomáš Pečený May 10 '14 at 20:47
  • @TomasPeceny no, sorry. As far as I can tell this isn't possible with krusader. Your best bet would be to use a terminal and issue the command above. – terdon May 10 '14 at 20:49
  • Should I connect the PCs by samba? I have tried it, but the connection worked only from PC1 to PC2, not from PC2 to PC1. I had similar problem in Windows XP, but it may be connected with antivirus AVG firewall setting and I need not solve it. I think it is not due to hardware: after interchanging ethernet cables the connection worked again from PC1 to PC2, not from PC2 to PC1. Maybe the solution for me is to use user commands if they can be done by Krusader as they are done with the Total Commander. – Tomáš Pečený May 10 '14 at 21:02
  • @TomasPeceny huh? No, why smb? They're two Linux boxes, if anything you should use NFS. In any case, you don't need to mount anything. Just open a terminal and run scp -p source user@target:/path/to/target and that will copy the file source to target on the remote machine, keeping the same modification date. Mounting the directories locally would not help you use krusader for what you want. You would have the same problem. – terdon May 10 '14 at 21:05
  • Up to now I use Krusader as I have described; because the PC stands yet at my table beside the other PC aimed as a backup one, I copy the files using the destination PC. This way, the date stamps are retained. I hope that in future I will be able to modify slightly the sources and translate them. In the meantime, is it useful to suggest it to the Krusader authors? Could you yield me a direct contact? Date stamps retaining is not the only improvement I see as generally useful. Or should I first let the improvement themes to be discussed here? By what form; as a question? Thanks! – Tomáš Pečený May 25 '14 at 18:41
  • 1
    @TomasPeceny no, not here, the authors are unlikely to see it. There is almost certainly a bug tracking system for krusader or you could submid to the KDE maintainers. I've never used it though so I can't tell you any more than that, sorry. – terdon May 25 '14 at 20:39
  • Thanks, I have proposed it to the Krusader developers forum https://groups.google.com/forum/#!topic/krusader-devel/hxxQXYYTguo . – Tomáš Pečený May 26 '14 at 10:21
  • I begin trying to adjust it myself. Please look at my questions http://askubuntu.com/questions/485242/an-introduction-to-translating-and-debugging-source-code and at the example linked from it. Would you give me a tip for such a general introduction? Thanks! – Tomáš Pečený Jun 19 '14 at 16:49
  • @TomasPeceny I wish you the best of luck with it but I'm afraid that kind of open ended question is too broad for the Q&A format of the stackexchange sites. There are many IDEs available for Linux and C is the language of choice but I can't really give you any more than that. – terdon Jun 19 '14 at 16:56