# How can I not preserve file timestamps?

**URL:** <https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904>\
**Category:** Help and Support\
**Created:** [March 13, 2020, 8:22pm UTC](https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904 "2020-03-13T20:22:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpsmith](https://forum.rclone.org/letter_avatar_proxy/v4/letter/l/8491ac/32.png) [@lpsmith](https://forum.rclone.org/u/lpsmith)\
**Post date:** [March 13, 2020, 8:22pm UTC](https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904/1 "2020-03-13T20:22:48Z")

</div>

I would like to copy some files out of a nix store into Google Drive. The hitch is that the nix store sets the modification time of every file inside of it to `1970-01-01 00:00:00Z` , so that the modification time cannot be used to break reproducible builds. However, I would prefer to have the upload time correctly reflected in Google Drive.

1. I could copy the file out of the nix store into another file in the local filesystem, but I would strongly prefer to avoid this step, as it's unnecessary and the files can be quite large.
2. I could pass an option to `rclone` to not preserve modification time, not unlike `cp` 's `--no-preserve=timestamps` option. (Although, `cp` doesn't preserve timestamps by default) However, I'm not seeing any documentation that this option exists, if it exists at all.
3. I tried creating a symlink to the file inside the nix store, hoping that rclone would pick up the modification time of the symlink, but this fails. For example, if I try this to copy the rclone executable to google drive:

```auto
$ ls -lh /nix/store/kvrpcbi3ph4m9a8jjp7bd445w690wdqs-rclone-1.48.0/bin
total 17M
-r-xr-xr-x 1 root root 34M Dec 31 1969 rclone

$ ln -s /nix/store/kvrpcbi3ph4m9a8jjp7bd445w690wdqs-rclone-1.48.0/bin/rclone rclone-symlink

$ rclone copy --copy-links rclone-symlink remote:

```

However, this symlink trick doesn't work, as `rclone` is still uploading the file with the timestamp `1970-01-01 00:00Z`. (Although, as it turns out, `cp --preserve=timestamps` exhibits the same behavior)

---

<div class="post-metadata">

**Author:** ![calisro](https://forum.rclone.org/user_avatar/forum.rclone.org/calisro/32/3130_2.png) [@calisro](https://forum.rclone.org/u/calisro)\
**Post date:** [March 13, 2020, 8:48pm UTC](https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904/2 "2020-03-13T20:48:23Z")

</div>

If you want a hack. You could mount the local filesystem elsewhere to another directory with the 'rclone mount /data/log ~/t **--no-modtime**' set. That will give you the mount time and not the actual time. It isn't really 'created' time. Then you can sync from there. It'll be slower a little and more CPU since you're going through rclone to sync but it shouldn't be too bad.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [March 13, 2020, 9:33pm UTC](https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904/3 "2020-03-13T21:33:11Z")

</div>

> [@lpsmith](#):
>
> I could pass an option to `rclone` to not preserve modification time, not unlike `cp` 's `--no-preserve=timestamps` option. (Although, `cp` doesn't preserve timestamps by default) However, I'm not seeing any documentation that this option exists, if it exists at all.

Such an option doesn't exist at the moment.

A drive specific option would be easy to do... You'd just need to not do this line - you could try commenting it out to see if that would work.

> <https://github.com/rclone/rclone/blob/6d0063d6852a8e47290f6f82fe6debd460768060/backend/drive/drive.go#L1819>

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [May 13, 2020, 5:41pm UTC](https://forum.rclone.org/t/how-can-i-not-preserve-file-timestamps/14904/4 "2020-05-13T17:41:17Z")

</div>

Closed on May 13, 2020, 5:41pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
