保留使用 nautilus 下载的文件的原始时间戳

保留使用 nautilus 下载的文件的原始时间戳

有没有办法在使用 nautilus ftp 从服务器下载时保留原始文件日期?就像现在一样,文件的日期/时间是下载的日期/时间,而不是服务器中的日期/时间?

答案1

作为一种解决方法,wget 默认会这样做。从manpage(手册页)

   --timestamping
       Turn on time-stamping.

   --no-use-server-timestamps
       Don't set the local file's timestamp by the one on the server.

       By default, when a file is downloaded, it's timestamps are set to
       match those from the remote file. This allows the use of
       --timestamping on subsequent invocations of wget. However, it is
       sometimes useful to base the local file's timestamp on when it was
       actually downloaded; for that purpose, the
       --no-use-server-timestamps option has been provided.

对于 nautilus,您可能需要提交错误报告(功能请求):https://bugzilla.gnome.org/browse.cgi?product=nautilus

答案2

如果您可能从终端执行操作,cp命令可以帮助您-p选择。

-p
same as --preserve=mode,ownership,timestamps

--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, all

相关内容